Group: | String Manipulation |
See also: | atof string substr |
Function: | strtok | |
Description: | splits a string into tokens. Therefore a set of delimiters has to be specified, i.e., characters that separate the tokens, which are not returned themselves. |
Usage: | z = strtok (str, del) | |
Input: | ||
str | 1 x 1 vector containing a string which ; should be splitted. | |
del | 1 x 1 vector containing a set of delimiters | |
Output: | ||
z | n x 1 vector, showing the substrings of str |
str="st,rt,o,k" strtok(str,",")
Contents of strtok [1,] "st" [2,] "rt" [3,] "o" [4,] "k"
str="st,rt-o|k" strtok(str,",-|")
Contents of strtok [1,] "st" [2,] "rt" [3,] "o" [4,] "k"