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 |
XSLT Function DeclarationSee XQuery definition. | <xsl:function name="functx:reverse-string" as="xs:string"
xmlns:functx="http://www.functx.com">
<xsl:param name="arg" as="xs:string?"/>
<xsl:sequence select="
codepoints-to-string(reverse(string-to-codepoints($arg)))
"/>
</xsl:function>
|
ExamplesXPath Example | Results |
---|
functx:reverse-string('abc') |
cba |
functx:reverse-string('a') |
a |
See AlsoHistory |
Recommended Reading:
|