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.
Returns
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:
<token>2007</token> <token>09</token> <token>14</token> <token>11</token> <token>40</token> <token>23</token>
Specifications
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
str:tokenize() | Chrome ? | Edge ? | Firefox Full support 3 | IE ? | Opera ? | Safari ? | WebView Android ? | Chrome Android ? | Firefox Android Full support 4 | Opera Android ? | Safari iOS ? | Samsung Internet Android ? |
Legend
- Full support
- Full support
- Compatibility unknown
- Compatibility unknown