STD.Str.SplitWords( src, separator [ , allow_blank ] )
STD.Uni.SplitWords( src, separator [ , allow_blank ] )
src | A string containing the words to extract. |
separator | A string containing the word delimiter to use. |
allow_blank | Optional. If TRUE, specifies allowing blank items in the result. If omitted, the default is FALSE. |
Return: | SplitWords returns a SET OF STRING or a UnicodeSet, as appropriate . |
The SplitWords function returns the list of words in the src string split out by the specified separator. No spaces are stripped from either string before matching.
Example:
IMPORT Std; str1 := 'a word a day keeps the doctor away'; str2 := 'a|word|a|day|keeps|the|doctor|away'; STD.STr.SplitWords(str1,' '); //returns ['a', 'word', 'a', 'day', 'keeps', 'the', 'doctor', 'away'] STD.STr.SplitWords(str2,'|'); //returns ['a', 'word', 'a', 'day', 'keeps', 'the', 'doctor', 'away']