Description
The functx:lines function splits a string into individual lines, using the carriage return and newline characters to indicate the end of a line.
Arguments and Return TypeName | Type | Description |
$arg |
xs:string? |
the string to split |
return value |
xs:string* |
XQuery Function DeclarationSee XSLT definition. | declare namespace functx = "http://www.functx.com";
declare function functx:lines
( $arg as xs:string? ) as xs:string* {
tokenize($arg, '(\r\n?|\n\r?)')
} ; |
Exampleslet $in-xml := | <in-xml>a
value
on
many
lines</in-xml> | return |
XQuery Example | Results |
---|
functx:lines('a value') |
a value |
functx:lines($in-xml) |
('a',
'value',
'on',
'many',
'lines') |
See AlsoHistory |
Recommended Reading:
|