std-strsplit


Synopsis

(std-strsplit <str> <delim>)

Description

STD-STRSPLIT splits a string into a list of strings keeping null tokens. It omits all characters in delim, which is a string seperating the list entries. The order of chars in delim is important.

Note that STD-STRSPLIT is useful for reading comma delimited lists from a file. It keeps empty strings. A similar function is std-strtok which does not keep null tokens and is therefore unsuitable for CDF files.

It is the exact complement to STD-STRJOIN, a complete roundtrip
(STD-STRJOIN (STD-STRSPLIT s d) d) is possible.

Example

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

Arguments

str: a string.

delim: a string.

Return Value

A list of strings or nil.

Side Effects

None.

Module

(std-require 'STDSTR)

Defined in STDSTR