Skip to content

dos_strtokens

Dale Fugier edited this page Jul 1, 2026 · 1 revision

Converts a string of tokens into a list.

Syntax

(dos_strtokens string tokens [T])

Parameters

string

A string.

tokens

A string interpreted as a set of delimiter characters.

T

If specified, the result is compatible with the strtok C/C++ run-time library function.

Returns

A list of strings, if successful.

nil on error.

Example

Command: (dos_strtokens "Hockey is the best." " ")
("Hockey" "is" "the" "best.")

Command: (dos_strtokens "A string\tof ,,tokens\nand some more tokens" " ,\t\n" t)
("A" "string" "of" "tokens" "and" "some" "more" "tokens")

Command: (dos_strtokens "0,0,,0,0" ",")
("0" "0" "" "0" "0")

Command: (dos_strtokens "0,0,,0,0" "," t)
("0" "0" "0" "0")

Clone this wiki locally