std-strtok


Synopsis

(std-strtok <str> <delims>)

Description

"String tokenizer"

STD-STRTOK splits a string into a list of strings removing null tokens. It omits all characters in delims which is a set of delimiting characters. The order of chars in delim is not important.

Note that STD-STRTOK is useful for removing unwanted whitespace or "noise". It doesn't keep null tokens. A similar function is STD-STRSPLIT which may keep null tokens.

Example

(std-strtok "  , 1, 2") ", ") => ("1" "2")

Arguments

str: a string.

delim: a string as set of chars

Return Value

A list of strings or nil.

Side Effects

None.

Module

(std-require 'STDSTR)

Defined in STDSTR