Click or drag to resize

string.split Function

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
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.

Syntax

Alchemy
string.split(expr, chr);

Nomenclature

exprThe string to split
chr A single-character delimiter used to split expr

Returns

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.

Examples

Alchemy
$arr = string.split("1234321", "2");
PRINT $arr; /* [1, 343, 1] */

$arr = string.split("1234321", "0");
PRINT $arr; /* [1234321] */