String Processing Functions
This section describes expression language functions related to processing strings.
Function | Description | Result Type | Backend Support | Frontend Support |
char(Integer code[, String encoding]) | Creates a single-character string using the provided character code. Uses the specific encoding or UTF-8 if no encoding provided. | String | Yes | No |
charAt(String string, Integer index) | Returns the integer code of the character at the specified index. | Integer | Yes | No |
concat(String string1 [, String String2, ...]) | Appends strings to one another. Null parameters are skipped. If a parameter is a DataTable, all its cells are sequentially converted to strings and appended. Any other non-string parameters are converted to strings. | String | Yes | No |
contains(String string, String substring) | Returns true if and only if string contains the specified substring. | Boolean | Yes | Yes |
endsWith(String string, String suffix) | Returns true if string ends with the specified suffix. Note that the result will be true if the suffix is the empty string or is equal to the string argument. | Boolean | Yes | Yes |
format(String pattern, Object parameter1,...) | Formats several parameters into a string using a supplied pattern. See Generic Object Formatting for details. Tip: this function can be used to format numbers to strings using specific radix, i.e. hex or binary. For example | String | Yes | Yes |
groups(String source, String regex) | Matches a source string to a given regular expression and returns values of regular expression groups found. See Groups and Capturing section in Regular Expression Syntax appendix for details on how to define and use groups. If just a single group was found, its content is returned as a String. If more groups were found, this function returns a Data Table with a single record and multiple string fields containing values of all groups. Group 0 (the whole expression) is never returned and not counted. | Object | Yes | Yes |
isBlank(String string) | Returns true if the string is null, has zero length, or contains only whitespace characters. | Boolean | Yes | No |
isDigit(String character) | Returns true if first character of the character string is a digit. | Boolean | Yes | Yes |
isEmpty(String string) | Returns true if the string is null or has zero length. | Boolean | Yes | No |
isLetter(String character) | Returns true if first character of the character string is a letter. | Boolean | Yes | Yes |
isLowerCase(String character) | Returns true if first character of the character string is a lower case letter. | Boolean | Yes | Yes |
isUpperCase(String character) | Returns true if first character of the character string is an upper case letter. | Boolean | Yes | Yes |
isWhitespace(String character) | Returns true if first character of the character string is a whitespace character. | Boolean | Yes | Yes |
index(String string, String substring [, Integer fromIndex]) | Returns the zero-based index within string of the first occurrence of the specified substring, starting at the specified fromIndex if it's specified. If substring is not found, -1 is returned. | Integer | Yes | Yes |
lastIndex(String string, String substring, Integer fromIndex) | Returns the zero-based index within string of the rightmost occurrence of the specified substring, searching backward starting at the specified fromIndex if it's specified. If substring is not found, -1 is returned. | Integer | Yes | Yes |
left(String string [, Integer charCount]) | Returns the first character or charCount leading characters of the string. | String | Yes | No |
length(String string) | Returns the length of the string. | Integer | Yes | Yes |
lower(String string) | Converts all of the characters in the string to lower case. | String | Yes | Yes |
mid(String input, Integer beginIndex, Integer length) | Returns a new string that is a substring of the input string. The substring begins at the specified beginIndex (inclusively) and has the given length. If beginIndex + length exceeds the input string length, the substring extends only to the end of the string. | String | Yes | No |
replace(String string, String target, String replacement) | Replaces each substring of the string that matches the target substring with the specified replacement string. The replacement proceeds from the beginning of the string to the end, for example, replacing "aa" with "b" in the string "aaa" will result in "ba" rather than "ab". | String | Yes | Yes |
replaceSmart(String string, String regex, String replacement) | Replaces each substring of the string that matches the given regular expression regex to or according to the given replacement string. The replacement string may contain references to subsequences captured during the previous match: Each occurrence of Note that backslashes ( | String | Yes | No |
right(String string [, Integer charCount]) | Returns the last character or charCount trailing characters of the string. | String | Yes | No |
split(String string, String regex [, String fieldName [, Integer limit]]) | Splits this string around matches of the given regular expression. The table returned by this function contains each substring of this string that is terminated by another substring that matches the given regex or is terminated by the end of the string. The substrings in the table are in the order in which they occur in this string. If the expression does not match any part of the input then the resulting table has just one record, namely this string. The limit parameter controls the number of times the pattern is applied and therefore affects number of records of the resulting table. If the limit n is greater than zero then the pattern will be applied at most n - 1 times, the table's length will be no greater than n, and the tables's last record will contain all input beyond the last matched delimiter. If n is non-positive then the pattern will be applied as many times as possible and the table can have any length. If n is zero (this is the default value) then the pattern will be applied as many times as possible, the table can have any length, and trailing empty strings will be discarded. The resulting table has a single String field named fieldName (default is Examples:
| DataTable | Yes | Yes |
startsWith(String string, String prefix) | Returns true if string starts with the specified prefix. Note also that true will be returned if the prefix is an empty string or is equal to the string. | Boolean | Yes | Yes |
substring(String string, Integer beginIndex [, Integer endIndex]) | Returns a new string that is a substring of the string. The substring begins at the specified beginIndex (inclusively) and extends to the character at index endIndex - 1 or to the end of string if endIndex is not specified. Examples:
| String | Yes | Yes |
trim(String string [, Boolean inside]) | Returns a copy of the string, with leading and trailing whitespace omitted. If inside parameter is true, also replaces all whitespace sequences found within the string by single spaces. | String | Yes | Yes |
upper(String string) | Converts all of the characters in the string to upper case. | String | Yes | Yes |
urlDecode(String string, String encoding) | Decodes an application/x-www-form-urlencoded string using a specific encoding scheme. The supplied encoding is used to determine what characters are represented by any consecutive sequences of the form Note: The World Wide Web Consortium Recommendation states that | String | Yes | Yes |
urlEncode(String string, String encoding) | Translates a string into application/x-www-form-urlencoded format using a specific encoding scheme. This method uses the supplied encoding to obtain the bytes for unsafe characters. Note: The World Wide Web Consortium Recommendation states that | String | Yes | Yes |
Was this page helpful?