The substring-after function returns a string that is the rest of a given string after a given substring.
Syntax
substring-after( haystack, needle )
Parameters
haystack- : The string to be evaluated. Part of this string will be returned.
needle- : The substring to search for. Everything after the first occurrence of
needleinhaystackwill be returned.
- : The substring to search for. Everything after the first occurrence of
Return value
A string.
Examples
| XPath Example | Output |
|---|---|
substring-after('aa-bb','-') |
bb |
substring-after('aa-bb','a') |
a-bb |
substring-after('aa-bb','b') |
b |
substring-after('aa-bb','q') |
(empty string) |
Specifications
Gecko support
Supported.
来源:MDN Web Docs / Mozilla 贡献者 · 作者与贡献记录 · CC BY-SA 2.5。离线整理了版式、链接和媒体显示。
