Description
The fn:ends-with function returns an xs:boolean value indicating whether one string ($arg1) ends with the characters of a second string ($arg2). Trailing whitespace is significant, so you may want to use the fn:normalize-space function to trim the strings before using this function.
This description is © Copyright 2007, O'Reilly Media. It is excerpted from the book XQuery by Priscilla Walmsley, O'Reilly, 2007. For a complete explanation of this function, please refer to Appendix A of the book. Arguments and Return Type| Name | Type | Description |
$arg1 |
xs:string? |
the entire string to test |
$arg2 |
xs:string? |
the substring to check for |
$collation |
xs:string |
the collation to use for comparing |
| return value |
xs:boolean |
Examples| XSLT Example | Results |
|---|
ends-with('query', 'y')
|
true
|
ends-with('query', 'query')
|
true
|
ends-with('query', '')
|
true
|
ends-with('query ', 'y')
|
false
|
ends-with('', 'y')
|
false
|
See AlsoHistory |
|