| MATLAB Function Reference | ![]() |
Syntax
token = strtok('str',delimiter)
token = strtok('str')
[token,rem] = strtok(...)
Description
token = strtok(' returns the first token in the text string str',delimiter)
str, that is, the first set of characters before a delimiter is encountered. The vector delimiter contains valid delimiter characters. Any leading delimiters are ignored.
token = strtok(' uses the default delimiters, the white space characters. These include tabs (ASCII 9), carriage returns (ASCII 13), and spaces (ASCII 32). Any leading white space characters are ignored.str')
[token,rem] = strtok(...)
returns the remainder rem of the original string. The remainder consists of all characters from the first delimiter on.
Examples
s = ' This is a good example.'; [token,rem] = strtok(s) token = This rem = is a good example.
See Also
| strrep | struct | ![]() |