Description
The functx:left-trim function removes all whitespace at the beginning of a string. Whitespace is defined as it is in XML, namely as the characters space, tab, carriage return and line feed. If $arg is the empty sequence, it returns a zero-length string.
Arguments and Return Type| Name | Type | Description |
$arg |
xs:string? |
the string to trim |
| return value |
xs:string |
XSLT Function Declaration| See XQuery definition. | | XSLT 2.0 Syntax: |
|---|
<xsl:function name="functx:left-trim" as="xs:string"
xmlns:functx="http://www.functx.com" >
<xsl:param name="arg" as="xs:string?"/>
<xsl:sequence select="
replace($arg,'^\s+','')
"/>
</xsl:function>
|
Examples| XSLT Example | Results |
|---|
functx:left-trim(' xyz')
|
xyz
|
functx:left-trim(' xyz x')
|
xyz x
|
functx:left-trim('xyz')
|
xyz
|
See AlsoHistory |
|