Description
The functx:index-of-string-last function returns an integer representing the last position of $substring within $arg. If $arg does not contain $substring, the empty sequence is returned.
Arguments and Return Type| Name | Type | Description |
$arg |
xs:string? |
the string |
$substring |
xs:string |
the substring to find |
| return value |
xs:integer? |
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:index-of-string-last
( $arg as xs:string? ,
$substring as xs:string ) as xs:integer? {
functx:index-of-string($arg, $substring)[last()]
} ; | | XQuery Syntax for May 2003: |
|---|
declare namespace functx = "http://www.functx.com"
define function index-of-string-last
( $arg as xs:string? ,
$substring as xs:string ) as xs:integer? {
functx:index-of-string($arg, $substring)[fn:last()]
} |
Examples| XQuery Example | Results |
|---|
functx:index-of-string-last(
'abcdabcdabcd','abc')
|
9
|
functx:index-of-string-last(
'abcd','abc')
|
1
|
functx:index-of-string-last(
'xxx','abc')
|
()
|
Depends OnSee AlsoHistory |
|