Skip to content

strtok

strings · scripts/strings/strtok.m

: tok = strtok (str)
: tok = strtok (str, delim)
: [tok, rem] = strtok (…)

Extract the first token of str.

Each character of delim is a separator (default: white space, characters 9 to 13 and 32). Separators at the start are skipped; tok runs up to the next separator and rem holds the rest of the text, starting with that separator. str may also be a cell array of strings, in which case both outputs are cell arrays.