xf:substring-after

Finds the substring that follows $string-var2 in $string-var1.

Signatures

xf:substring-after(xs:string? $string-var1, xs:string? $string-var2) —> xs:string?

Arguments

Data Type
Argument
Description

xs:string?

$string-var1

Represents the source string.

xs:string?

$string-var2

Represents the comparison string.

Returns

Returns the part of the $string-var1 source string that follows $string-var2.

Returns the value of $string-var1, if $string-var2 is a zero-length string ("").

Returns a zero-length string (""), if $string-var1 does not contain $string-var2.

If the value of $string-var1 or $string-var2 is the empty sequence, the empty sequence is returned. The empty sequence is a sequence containing zero items (), which is similar to null in SQL.

Examples

This Query . . .
Generates This Result . . .

<r>{xf:substring-after("super", "p")}</r>

<r>er</r>

<r>{xf:substring-after("super", "")}</r>

<r>super</r>

<r>{xf:substring-after("super", "z")}</r>

<r/>

<r>{xf:substring-after("super", ())}</r>

<r/>

Related Topics

W3C substring-after function description.