functx:index-of-string-first

The first position of a substring

Description

The functx:index-of-string-first function returns an integer representing the first position of $substring within $arg. If $arg does not contain $substring, the empty sequence is returned.

Parameters

Description

arg:string()

the string

substring:string()

the substring to find

Examples

XPath

Results

functx:index-of-string-first(‘abcdabcdabcd’,’abc’)

1

functx:index-of-string-first(‘abcd’,’abc’)

1

functx:index-of-string-first(‘xxx’,’abc’)

()

See Also