Split
Take a source string and split it into substrings.
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
~
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.
Last modified August 31, 2024: Signed-off-by: tracyragan <[email protected]> (20379ca)