Loading TOC...

fn.tokenize

fn.tokenize(
   $input as String?,
   $pattern as String,
   [$flags as String]
) as Sequence

Summary

Returns a sequence of strings contructed by breaking the specified input into substrings separated by the specified $pattern. The specified $pattern is not returned as part of the returned items.

Parameters
$input The string to tokenize.
$pattern The regular expression pattern from which to separate the tokens.
$flags The flag representing how to interpret the regular expression. One of "s", "m", "i", or "x", as defined in http://www.w3.org/TR/xpath-functions/#flags.

Example

fn.tokenize("this is a string", " ");

=> returns the Sequence containg:
   ("this", "is", "a", "string")

var arr = fn.tokenize("this is a string", " ").toArray();
arr[arr.length-1]

=> string

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy