str:tokenize()

str:tokenize() splits a string using a set of characters as delimiters that determine where the splits should occur, returning a node-set containing the resulting strings.

Syntax

str:tokenize(string, delimiters)

Parameters

string

The string to tokenize.

delimiters

Each character in this string is used as a word separator while tokenizing.

Return value

A node-set of token elements, each containing one token from the string.

Example

str:tokenize('2007-09-14-03T11:40:23', '-T:')

Returns a node set like this:

xml
2007
09
14
11
40
23

Specifications

See also