unitok
Searches a string for tokens separated by specified delimiters
#include <unicode.h>
N_EXTERN_LIBRARY(punicode) unitok (
punicode s1,
const unicode N_FAR *s2);
uses netwin32
Function unitok
(s1 : punicode;
s2 : const unicode
) : punicode;
If a delimiter is found, returns a pointer to the first byte of a token. On subsequent iterations if no delimiter is found, returns a null pointer.
If the string does not contain any of the delimiters specified in s2, returns a pointer to the string. All of the string is considered to be a token.
The unitok function considers the string pointed to by the s1 parameter to consist of a sequence of zero or more text tokens, separated from the delimiter pointed to by the s2 parameter by spans of one or more characters.
The first call to unitok returns a pointer to the first character of the first token in the string parameter and writes a null character into the string parameter immediately following the returned token. The unitok function sets the string parameter to a null pointer which allows unitok, on subsequent calls, to search through the string and return successive tokens, until no tokens remain. Because unitok can modify the original string, that string should be duplicated if the string is to be reused.
The unitok function corresponds to the strtok function.
For sample code, see Section 3.30, Example: unitok.