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 |
XQuery Function Declaration| See XSLT definition. | | XQuery Syntax for July 2004 - January 2007 (1.0): |
|---|
declare namespace functx = "http://www.functx.com";
declare function functx:left-trim
( $arg as xs:string? ) as xs:string {
replace($arg,'^\s+','')
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function left-trim
( $arg as xs:string? ) as xs:string {
fn:replace($arg,'^\s+','')
} |
Examples| XQuery Example | Results |
|---|
functx:left-trim(' xyz')
|
xyz
|
functx:left-trim(' xyz x')
|
xyz x
|
functx:left-trim('xyz')
|
xyz
|
See AlsoHistory |
|