string-join

Concatenates a sequence of strings using an optional separator

Description

The fn:string-join function concatenates a sequence of strings. The $arg1 argument specifies the sequence of strings to concatenate, while $arg2 specifies the separator. If $arg2 is a zero-length string, no separator is used.

Parameters

Description

arg1:string()

the sequence of strings to join

arg2:string()

the delimiter

Examples

XPath

Results

string-join( (‘a’, ‘b’, ‘c’), ‘’)

abc

string-join( (‘a’, ‘b’, ‘c’), ‘/*’)

a/*b/*c

string-join( (‘a’, ‘’, ‘c’), ‘/*’)

a/*/*c

string-join( ‘a’, ‘/*’)

a

string-join((), ‘/*’)

zero-length string

See Also