XPath String Functions
XPath String Functions
A list of XPath string functions:
Function | Description |
---|---|
starts-with(string1, string2) | It returns true when first string starts with the second string. |
contains(string1, string2) | It returns true when the first string contains the second string. |
substring(string, offset, length?) | It returns a section of the string. The section starts at offset up to the length provided. |
substring-before(string1, string2) | It returns the part of string1 up before the first occurrence of string2. |
substring-after(string1, string2) | It returns the part of string1 after the first occurrence of string2. |
string-length(string) | It returns the length of string in terms of characters. |
normalize-space(string) | It trims the leading and trailing space from string. |
translate(string1, string2, string3) | It returns string1 after any matching characters in string2 have been replaced by the characters in string3. |
concat(string1, string2, ...) | It is used to concatenate all strings. |
format-number(number1, string1, string2) | It returns a formatted version of number1 after applying string1 as a format string. String2 is an optional locale string. |