Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

split


str:split() splits a string using a pattern string to determine where the splits should occur, returning a node-set containing the resulting strings.

Syntax

str:split(string, pattern)

Arguments

string
The string to split.
pattern
The pattern indicating where to split the string.

Returns

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

For example:

str:split('book, phone, computer, chair', ', ')

Returns a node set like this:

<token>book</token>
<token>phone</token>
<token>computer</token>
<token>chair</token>

Defined

EXSLT - STR:SPLIT

Gecko support

Supported in Gecko 1.9 and later.

Document Tags and Contributors

 Contributors to this page: Sheppy, Mgjbot, Talisker, Fredchat
 Last updated by: Sheppy,