Template Engine language reference > Template Engine utilities > String functions > $string.split

$string.split
This function splits the input string into multiple substrings. It searches the input string for the separator specified in the function, and when a separator is found, the preceding substring is identified. All substrings are returned as an array of strings.
Syntax
$string.split(<inStr>, <separator>)
inStr
separator
The separator (one or more characters) that determines how to split the input string into substrings. The separators are not included in the returned result.
Template examples
Example 109
Template
#set($str='Species;Breed;Name;Age;Color')
#set($str2=$string.split($str, ';'))
Original string: $str
Array:
#foreach($i in $str2)
$i
#end
Output
Original string: Species;Breed;Name;Age;Color
Array:
Species
Breed
Name
Age
Color
 
OpenText StreamServe 5.6.2 Updated: 2018-01-26