Package org.jaxen.function
Class SubstringBeforeFunction
java.lang.Object
org.jaxen.function.SubstringBeforeFunction
- All Implemented Interfaces:
Function
4.2 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.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the part of the string-value of the first item inargs
that comes before the string-value of the second item inargs
; or the empty string if the second string is not a substring of the first string.static String
Returns the part ofstrArg
that precedes the first occurence ofmatchArg
; or the empty string if thestrArg
does not containmatchArg
-
Constructor Details
-
SubstringBeforeFunction
public SubstringBeforeFunction()Create a newSubstringBeforeFunction
object.
-
-
Method Details
-
call
Returns the part of the string-value of the first item inargs
that comes before the string-value of the second item inargs
; or the empty string if the second string is not a substring of the first string.- Specified by:
call
in interfaceFunction
- Parameters:
context
- the context at the point in the expression when the function is calledargs
- a list that contains two items- Returns:
- a
String
containing that part of the string-value of the first item inargs
that comes before the string-value of the second item inargs
- Throws:
FunctionCallException
- ifargs
does not have length two
-