Description
The fn:contains function returns true if $arg1 contains the characters of $arg2 anywhere in its contents, including at the beginning or end.
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 string to test |
$arg2 |
xs:string? |
the substring to test for |
$collation |
xs:string |
the collation to use for sorting |
| return value |
xs:boolean |
Examples| XQuery Example | Results |
|---|
contains('query', 'e')
|
true
|
contains('query', 'ery')
|
true
|
contains('query', 'query')
|
true
|
contains('query', 'x')
|
false
|
contains('query', '')
|
true
|
contains('query', ())
|
true
|
contains( (), 'q')
|
false
|
See AlsoHistory |
|