functx:chars

Converts a string to a sequence of characters

Description

The functx:chars function splits a string into individual characters and returns them as a sequence of strings of length 1 each.

Parameters

Description

arg:string()

the string to split

Examples

XPath

Results

functx:chars('abc')

('a', 'b', 'c')

functx:chars('a b c')

('a', ' ', 'b', ' ', 'c')

In a generator

Copy the snippet below and paste it in Freemapper, under a language node inside the generators element. Each line of the pattern prints the result of one example; to see them, run mi generate <project> <language> example-functx-chars.

[e] example-functx-chars
    [e] start
        [e] match
            [v] /
        [e] body
            [e] write-pattern
                [v] examples
    [e] patterns
        [e] examples
            [v] E01: {{ functx:chars('abc') }}
            [v] E02: {{ functx:chars('a b c') }}

See Also