split

split(text:       String;
      pattern:    String;
      ignoreCase: Boolean;
      splits:     JadeRegexResult io): Integer;

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

The split method parameters are described in the following table.

Parameter Description
text Text string within which to find matches to be split.
pattern Regex pattern string to be used as a delimiter for splitting into substrings.
ignoreCase Specifies whether matching is case-sensitive.
splits JadeRegexResult contains JadeRegexMatch objects that represent the split substrings.

The following is an example of a split type method.

typeSplit();
vars
    splits : JadeRegexResult;
    numOfSplits, i : Integer;
begin
    numOfSplits := JadeRegex@split("this string will be split into words", 
                                   "\s", false, 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