string.split Function |
The string.split function splits a given string about a specified delimiter.
The string may be split multiple times, or if the delimiter is not found the string will not be split.
string.split(expr, chr);
expr | The string to split |
chr | A single-character delimiter used to split expr |
An array. Each element of the array contains a segment of the given string.
The specified delimiter will not be present in any element of the array.
$arr = string.split("1234321", "2"); PRINT $arr; /* [1, 343, 1] */ $arr = string.split("1234321", "0"); PRINT $arr; /* [1234321] */