functx:substring-after-if-contains
Performs substring-after, returning the entire string if it does not contain the delimiter
Description
The functx:substring-after-if-contains function performs substring-after, returning the entire string if it does not contain the delimiter. It differs from the built-in fn:substring-after function, which returns a zero-length string if the delimiter is not found.
Parameters |
Description |
---|---|
arg:string() |
the string to substring |
delim:string() |
the delimiter |
Examples
XPath |
Results |
---|---|
functx:substring-after-if-contains(‘abcd’,’b’) |
cd |
functx:substring-after-if-contains(‘abcd’,’x’) |
abcd |