Question

As the title suggests I'm looking to detect where the numbers are in a string and then to just take the substring from the larger string. EG

If I have say zero89 or eight78, I would just like zero or nine returned. When using the strsplit function I have:

strsplit('zero89', but what do I put here?)
Was it helpful?

Solution

Interested in regexp that will provide you more options to explore with?

Extract numeric digits -

regexp('zero89','\d','match')

Extract anything other than digits -

regexp('zero89','\d+','Split')

OTHER TIPS

strsplit('zero89', '\d', 'DelimiterType', 'RegularExpression')

Or just using regexp:

regexp('zero89','\D+','match')

I got the \D+ from here

Assuming you mean this strsplit?

strsplit('zero89', '8')
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top