Assume we have a string containing a list of customers in a string string :
Variable | Value |
---|
string | "Spring Corp., Summer Ltd.; Autumn & Co., Winter & Partners" |
Assuming that the split character is either the " ,
" or the " ;
", you can split this string with the following results:
Regular Expression | Result splittedStringArray |
---|
set splittedStringArray = string.split(",|;"); | ["Spring Corp.", "Summer Ltd.", "Autumn & Co.", "Winter & Partners"] |
set splittedStringArray = string.split("(,|;)"); | ["Spring Corp.", ",", "Summer Ltd.", ";", "Autumn & Co.", ",", "Winter & Partners"] |