Package com.singularsys.jep.functions.strings


package com.singularsys.jep.functions.strings
String functions.

The string functions can be simply included by using the jep.setComponent(new StringFunctionSet());. This will add the following functions to jep

  • concat(str1,str2,...): Concatenates string
  • left(str,len): returns the left most len characters from a string
  • right(str,len): returns the right most characters from a string
  • mid(str,start,len): returns the middle of a string
  • substr(str,start,end): returns a substring of a string
  • len(str): returns the length of a string
  • lower(str): converts a string to lower-case
  • upper(str): converts a string to upper-case
  • trim(str): removes leading and trailing whitespace
  • Classes
    Class
    Description
    Concatenates string arguments.
    Extract the left most n characters from a string: left("abcdefg",2) -> "ab" If n is greater than the length of the string return the full string. If n is less than zero an EvaluationException is thrown. If the first argument is not a string an EvaluationException is thrown. If the second argument is not a number representing an integer an EvaluationException is thrown.
    Returns the length of a string: len("hello") -> 5
    Convert a string to lowercase
    Extract substring of first argument: mid("abcdefg",2,3) -> "cde" Syntax: mid(str,start,len) Second argument is starting index, with the first character being at index 0.
    Extract the right most n characters from a string: right("abcdefg",2) -> "fg".
    Extract substring of first argument: substring("abcdefg",2,4) -> "cd".
    Trims leading and trailing whitespace
    Convert a string to uppercase