Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to use a string pattern in string.split as delimiter?

Asked by 4 years ago

I'm just wondering if there is a way to use a string pattern as a delimiter in string.split(s, delimiter). So I could use a number as a delimiter without needing to know exactly what it is since there can be different numbers delimiting.

The built-in one does not work with string patterns. string.split("lol1lol2lol3lol4", "%d+") seems to only delimit based on "%d+" literally. So is there a way to have "lol1lol2lol3lol4" be split based on numbers with "%d+"?

Answer this question