Split

split takes a source string and splits into a number of substrings. The split is performed at the specified character sequence. The resulting strings are returned in a List of Strings.


Usage:


String.split(seq)

Or

split(String,seq);


Returns:


Array. A List of Strings.


Example:


set mystr="/this/is/an/example";

set dirs=${mystr.split("/")};

foreach (d: $dirs) {

 echo "dir=${dirs[$d]}";

}


Result:


dir=this

dir=is

dir=an

dir=example