split

split(text:   String;
      splits: JadeRegexResult io): Integer;

The split method of the JadeRegexPattern class splits the specified text into substrings delimited by the pattern. The produced substrings are collated in a JadeRegexResult object with a JadeRegexMatch for each split of the string. This method returns the number of matching substrings that are found or it returns zero (0) if none are found.

The following is an example of the split method that performs a split of a text string into substrings.

split();
vars
    compiledPattern : JadeRegexPattern;
    splits : JadeRegexResult;
    numOfSplits, i : Integer;
begin
    create compiledPattern;
    compiledPattern.compile("\s");
    numOfSplits := compiledPattern.split("this string will be split into words", 
                        splits);
    foreach i in 1 to numOfSplits do
        write i.String&") "&splits.at(i).value;
    endforeach;
/*
1) this
2) string
3) will
4) be
5) split
6) into
7) words
*/
end;

2020.0.01 and higher