FUNCTION REFERENCE

strtok

First token of a character vector.

First token of a character vector.

Syntax

token = strtok(str)

Syntax

[token, remainder] = strtok(str, delimiters)

Skips leading delimiters and returns the text up to the next delimiter; the

remainder starts at that delimiter. The default delimiters are whitespace

(space, tab, newline, vertical tab, form feed, carriage return). For a cell

array of character vectors both outputs are cell arrays of the same size.

Example

[t, r] = strtok('a,b,c', ',')   % t = 'a', r = ',b,c'

Differences from MATLAB: string arrays are not supported.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.