- All Implemented Interfaces:
- Function
public class SubstringBeforeFunction
extends FunctionBase
implements Function
From http://docs.jsonata.org/string-functions.html:
$substringBefore(str, chars)
Returns the substring before the first occurrence of the character sequence
chars in str. If str is not specified (i.e. this function is invoked with
only one argument), then the context value is used as the value of str. If
str does not contain chars, then it returns str. An error is thrown if str
and chars are not strings.
Examples
$substringBefore("Hello World", " ")=="Hello"