split
This function takes the string string and splits it into a bunch of substrings. The substrings are return as a dataset with one column called "parts". The split occurs wherever the regular expression regexoccurs. Don't be intimidated by the regular expression, this is normally just another string, like "," for comma separated lists.
The optional limit argument, if greater than zero, limits the number of times the regex pattern is applied to limit-1. Put another way, it limits the length of the resulting dataset to length limit. If limit is non-positive then the regex pattern will be applied as many times as possible and the returned dataset can have any length. If limit is zero (the default) then the pattern will be applied as many times as possible, the returned dataset can have any length, and trailing empty strings will be discarded.
split( string, regex, [limit] )
split(
"hello,world"
,
","
)
//returns dataset ["hello","parts"]
split(
"boo:and:foo"
,
":"
)
//returns dataset ["boo", "and", "foo"]
split(
"boo:and:foo"
,
":"
,
2
)
//returns dataset ["boo", "and:foo"]