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?)
有帮助吗?

解决方案

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')

其他提示

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')
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top