Excerpt | ||
---|---|---|
| ||
split(string, separator) Splits a string where a separator occurs, returning a list of substrings. |
Function: split()
Splits a string where a separator occurs, returning a list of substrings.
Syntax
split(string, separator)
Argument | Type | Description |
---|---|---|
string | String | String to be split |
separator | Regular Expression | Regular expression representing the breakpoints in string where the splits should occur |
Note that the separator is expressed as a regular expression. This means that you can use any pattern that can be expressed as a regular expression as a separator. But it also means that you must escape any special characters of regular expressions if you are using these as plain text (e.g. you must use "\\|" to use | as a separator). See examples below.
...