Finds the next token in a string.
Kernel.bdh
Strtok( in sTokenString : string allownull, in sDelimiterSet : string ): string;
Next token found in sTokenString. This function returns an empty string when no more tokens are found. Each call modifies sTokenString by substituting a null character for each delimiter that is encountered.
Parameter | Description |
---|---|
sTokenString | Defines the string to search in. Each call modifies this parameter by substituting a null character for each delimiter that is encountered. |
sDelimiterSet | Defines a set of characters that subdivide the tokens. |
dcltrans transaction TStrtok var sTokenString, sDelimiterSet, sToken: string; begin sTokenString := "apples+peaches*bananas/physical training=" "very healthy"; sDelimiterSet := "+*/="; write("Tokens found: "); writeln; sToken := Strtok(sTokenString, sDelimiterSet); while sToken <> "" do write(sToken); write(", "); sToken := Strtok(NULL, sDelimiterSet); end; end TStrtok;
Tokens found: apples, peaches, bananas, physical training, very healthy,