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 Type| Name | Type | Description |
$arg |
xs:string? |
the string to reverse |
| return value |
xs:string |
XSLT Function Declaration| See XQuery definition. | | XSLT 2.0 Syntax: |
|---|
<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>
|
Examples| XSLT Example | Results |
|---|
functx:reverse-string('abc')
|
cba
|
functx:reverse-string('a')
|
a
|
See AlsoHistory |
|