Add XPath substring-before() and substring-after() functions

I think the XPath 1.0 definitions are probably sufficient to accomplish the desired result; specifically, no XPath 2.0 collations. [more so if I gotta implement it... :slight_smile: ]

From XPath1.0 Spec:

Function: string substring-before(string, string)

The substring-before function returns the substring of the first argument string that precedes the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-before("1999/04/01","/") returns 1999.

Function: string substring-after(string, string)

The substring-after function returns the substring of the first argument string that follows the first occurrence of the second argument string in the first argument string, or the empty string if the first argument string does not contain the second argument string. For example, substring-after("1999/04/01","/") returns 04/01, and substring-after("1999/04/01","19") returns 99/04/01.

So, unless this raises @LN from the dead, is this a go? :grin:

2 Likes