Return substring of a string value preceding another string.
fn:substring-before(string $string, string? $searchString) => string?
fn:substring-before(string $string, string? $searchString, string $collation) => string?
This function returns that part of $string
, which
precedes the string value searchString
.
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 the value of $string
. If the value of
$string
does not contain a string that is equal to the
value of $searchString
, then the function returns the
empty string
$string |
string value |
---|---|
$searchString |
string value that is searched in |
$collation |
optional valid collation string literal |
This query returns the string value "Tamino ":
substring-before("Tamino XML Server", "XML")
The following construct(s) refer to this construct: