Check whether a string ends with another string.
The following construct(s) refer to this construct:
fn:ends-with(string $term, string? $searchString) => boolean
fn:ends-with(string $term, string? $searchString, string $collation) => boolean
This function checks whether the value of $string
ends with the value of $searchString
according to the
collation used. It returns true
if it is found and
false
if not. If the value of $string
or
$searchString
is the empty sequence, the function
returns the empty sequence. If the value of
$searchString
is the empty string, then the function
returns "true". If the value of
$string
is the empty string and the value of
$searchString
is a non-empty string, the function
returns "false".
You can use an optional collation argument.
$term |
string value |
---|---|
$searchString |
string value that is searched for in |
$collation |
optional valid collation string literal |
Does "Tamino" end with "ino" ?
ends-with("Tamino", "ino")
The function returns true
, since
"ino" obviously appears at the end of
"Tamino".