Description
The functx:reverse-string function reverses the order of characters in a string. It returns a zero-length string if the argument is the empty sequence.
Arguments and Return TypeName | Type | Description |
$arg |
xs:string? |
the string to reverse |
return value |
xs:string |
XQuery Function DeclarationSee XSLT definition. | declare namespace functx = "http://www.functx.com";
declare function functx:reverse-string
( $arg as xs:string? ) as xs:string {
codepoints-to-string(reverse(string-to-codepoints($arg)))
} ; |
ExamplesXQuery Example | Results |
---|
functx:reverse-string('abc') |
cba |
functx:reverse-string('a') |
a |
See AlsoHistory |
Recommended Reading:
|