boolean isNotEmpty(String
<input>)
where <input> is the string to check.
|
Returns true if the input string is not empty ("" ) and not null.
|
-
#string.isNotEmpty('InputData')
-
#string.isNotEmpty('')
|
|
boolean isNotBlank(String
<input>)
where <input> is the string to check.
|
Returns true if the input string is not empty ("" ), not null and not white space only.
|
-
#string.isNotBlank('InputData')
-
#string.isNotBlank(' ')
|
|
String upperCase(String
<input>)
where <input> is the string being converted to upper case.
|
Converts all characters to uppercase. Returns all characters in upper case if input is not null. Returns null if input is null.
|
#string.upperCase('john')
|
|
String lowerCase(String
<input>)
where <input> is the string being converted to lower case.
|
Converts all characters to lowercase. Returns all characters in lower case if input is not null. Returns null if input is null.
|
#string.lowerCase('LOWER')
|
|
String trim(String
<input>)
where <input> is the string being trimmed.
|
Removes white space from the start and end of string if input is not null. Returns null if input is null.
|
#string.trim(' No Padding ')
|
|
String substring(String <input>,
int <start>, int
<end>)
-
<input> is the string to get the substring from
-
<start> is the position to start from
-
<end> is the exclusive position to end at
|
Gets a substring from the input string starting from the start position and up until the end position, not including the end position. You can use a negative value to start or end n characters from the end of the string. All position counting is zero-based. If start is not to the left of end, "" is returned. Returns null if input is null.
|
-
#string.substring('example input for substring
demo', 8, 13)
-
#string.substring('example input for substring
demo', -24, 13)
-
#string.substring('example input for substring
demo', -24, -19)
|
|
boolean startsWith(String
<input>, String
<prefix>)
|
Checks if the input string starts with the specified prefix and the comparison is case sensitive. Returns true if the input string starts with the prefix with the same case or if both are null.
|
#string.startsWith('InputData', 'In')
|
|
boolean endsWith(String <input>,
String <suffix>)
|
Checks if the input string ends with the specified suffix and the comparison is case sensitive. Returns true if input string ends with the suffix with the same case or if both are null.
|
#string.endsWith('InputData', 'Data')
|
|
String[] split(String <input>,
String <separators>)
|
Splits the provided text into an array based on the specified separators. Returned array won’t contain any separators. A null separator splits on white space. Returns null if input is null.
|
#string.split('Administrator, User, Guest', ',
')
|
["Administrator", "User", "Guest"]
|
String join(Array <values>,
String <separator>)
|
Joins the elements of the provided array into a single string containing the provided elements separated by the provided separator. Returns the joined string or null if the array is null.
|
#string.join(\{'Administrator', 'User', 'Guest'}, ',
')
|
Administrator, User, Guest
|
int indexOf(String <input>,
String <searchStr>, int
<fromIndex>)
-
<input> is the string to search against
-
<searchStr> is the string to find
-
<fromIndex> is the start position in the input string to start the search from
|
Finds the first index of the search string within the input string. A negative start position is treated as zero, and a start position greater than the input string length only matches an empty search. An empty search string ("" ) always matches. Returns -1 if a match is not found.
|
#string.indexOf('To find and return index or return -1',
'return', -1)
|
|
int lastIndexOf(String <input>,
String <searchStr>, int
<fromIndex>)
-
<input> is the string to search against
-
<searchStr> is the string to find
-
<fromIndex> is the start position in the input string to begin the search from
|
Finds the last index within the input string. Search starts from the start position and continues backwards. A negative start position is treated as zero, and a start position greater than the input string length searches the entire string backwards. Returns -1 if a match is not found.
|
#string.lastIndexOf('To find and return index or return
-1', 'return', 50)
|
|
int length(String
<input>)
where <input> is the string to find the length of.
|
Returns the length of the input string or 0 if input is null.
|
|
|
String replace(String <input>,
String <searchStr>, String
<replacement>, int
<max>)
-
<input> is the string to be searched against to be replaced in.
-
<searchStr> is the string to be matched and replaced.
-
<replacement> is the string to be replaced with.
-
<max> is the maximum number of times replacement should be done. If -1 , all matched values will be replaced.
|
Replaces all occurrences of searchStr within input according to the replacement and max values. A null reference passed to this method is a no-op.
|
#string.replace('input values replaced by input
replacement', 'in', 'out', -1)
|
output values replaced by output replacement
|
int compare(String <str1>,
String <str2>, boolean
<ignoreCase>)
-
<str1> is the string to compare against
-
<str2> is the string to compare
-
<ignoreCase> determines whether the comparison is case-sensitive.
|
Compares two strings lexicographically. Returns 0 if str1 is equal to str2 or both are null. Returns a negative number if str1 is less than str2 . Returns a positive number if str1 is greater than str2 .
|
#string.compare('Input', 'INPUT', true)
|
|
Number asInt(String <input>,
Number
<defaultIfNullOrInvalid>)
-
<input> is the string representation of an integer number
-
<defaultIfNullOrInvalid> is the default value to be used if the string input is null, not a valid number, or out of range for integers
|
Parses the string argument as a signed decimal integer (min -2147483648 and max 2147483647 ).
The characters in the string must all be decimal digits, except that the first character can be an ASCII minus sign (- ) to indicate a negative value or an ASCII plus sign (+ ) to indicate a positive value. If input is null or not a valid integer, defaultIfNullOrInvalid is returned.
|
-
#string.asInt('12', 0)
-
#string.asInt('NaN', 0)
-
#string.asInt('9876543210123456789',
0)
|
|
Number asLong(String <input>,
Number
<defaultIfNullOrInvalid>)
-
<input> is the string representation of a Long number
-
<defaultIfNullOrInvalid> is the default value to be used if string input is null, not a valid number, or out of range for Longs
|
Parses the string argument as a signed decimal long (min -9223372036854775808 and max 9223372036854775807 ).
The characters in the string must all be decimal digits, except that the first character can be an ASCII minus sign (- ) to indicate a negative value or an ASCII plus sign (+ ) to indicate a positive value. If input is null or not a valid Long, defaultIfNullOrInvalid is returned.
|
-
#string.asLong('12', 0)
-
#string.asLong('NaN', 0)
-
#string.asLong('9876543210123456789',
0)
|
|
Number asBigInt(String <input>,
Number
<defaultIfNullOrInvalid>)
-
<input> is the string representation of a BigInteger number
-
<defaultIfNullOrInvalid> is the default value to be used if string input is null, not a valid number, or out of range for BigInteger
|
Translates the decimal string representation of a BigInteger into a BigInteger.
The string representation consists of an optional minus sign followed by a sequence of one or more decimal digits. The character-to-digit mapping is provided by Character.digit. If input is null or not a valid Big Integer, defaultIfNullOrInvalid is returned.
|
-
#string.asBigInt('1234567890987654321',
0)
-
#string.asBigInt('NaN', 0)
|
|
Number asFloat(String <input>,
Number
<defaultIfNullOrInvalid>)
-
<input> is the string representation of a Float number
-
<defaultIfNullOrInvalid> is the default value to be used if string input is null, not a valid number, or out of range for Floats
|
Parses the string argument as a signed decimal float. If input is null, not a valid Float, or Infinity, defaultIfNullOrInvalid is returned.
|
-
#string.asFloat('12.5', 0)
-
#string.asFloat('NaN', 0)
-
#string.asFloat('1234567899876543210123456789987654321019.12',
0)
|
|
Number asDouble(String <input>,
Number
<defaultIfNullOrInvalid>)
-
<input> is the string representation of a Double number
-
<defaultIfNullOrInvalid> is the default value to be used if string input is null, not a valid number, or out of range for doubles
|
Parses the string argument as a signed decimal double. If input is null, not a valid number within the range of Double, or Infinity, defaultIfNullOrInvalid is returned.
|
-
#string.asDouble('1234567899876543210123456789987654321019.12',
0)
-
#string.asDouble('NaN', 0)
|
-
1234567899876543210123456789987654321019.12
-
0
|
Number asBigDecimal(String
<input>, Number
<defaultIfNullOrInvalid>)
-
<input> is the string representation of a BigDecimal number
-
<defaultIfNullOrInvalid> is the default value to be used if string input is null, not a valid number, or out of range for BigDecimal
|
Translates the string representation of a BigDecimal into a BigDecimal.
The string representation consists of an optional sign, (+ or - ), followed by a sequence of zero or more decimal digits (the integer), optionally followed by a fraction, optionally followed by an exponent. The fraction consists of a decimal point followed by zero or more decimal digits. The string must contain at least one digit in either the integer or the fraction. The exponent consists of the character e or E followed by one or more decimal digits.
The value of the exponent must lie between -Integer.MAX_VALUE (Integer.MIN_VALUE+1) and Integer.MAX_VALUE , inclusive. If input is null or not a valid BigDecimal, defaultIfNullOrInvalid is returned.
|
-
#string.asBigDecimal('1234567890987654321.14',
0)
-
#string.asBigDecimal('NaN', 0)
|
|
String asBase64Encoded(String
<input>)
where <input> is the string to be encoded.
|
Encodes the input string into a new string using the Base64 encoding scheme. Returns the encoded string if input is not empty, or else input is returned as-is.
|
#string.asBase64Encoded('Test Value for
encoding')
|
VGVzdCBWYWx1ZSBmb3IgZW5jb2Rpbmc=
|
String asBase64Decoded(String
<input>)
where <input> is the Base64 encoded string to be decoded.
|
Decodes a Base64 encoded string into a new string using the Base64 encoding scheme. Returns the encoded string if input is not empty, or else input is returned as-is. This will return null if the input string is not in the valid Base64 schema.
|
#string.asBase64Decoded('VGVzdCBWYWx1ZSBmb3IgZW5jb2Rpbmc=')
|
|
String asUrlEncoded(String
<input>)
where <input> is the string to be encoded.
|
Translates a string into application/x-www-form-urlencoded format using UTF-8 encoding scheme. Returns the encoded string if input is not empty, or else input is returned as-is.
|
#string.asUrlEncoded('username=johndoe+admin')
|
username%3Djohndoe%2Badmin
|
String asUrlDecoded(String
<input>)
where <input> is the URL encoded string to be decoded.
|
Decodes an application/x-www-form-urlencoded string using UTF-8 encoding scheme. Returns the decoded string if input is not empty, or else input is returned as it is. Returns null if the input string cannot be decoded due to any illegal characters.
|
#string.asUrlDecoded('username%3Djohndoe%2Badmin')
|
|
String format(String <format>,
String… <args>)
-
<format> is the format supported by java.util.Formatter
-
<args> are the arguments referenced by the format specifiers in the format string. If there are more arguments than format specifiers, the extra arguments are ignored. The number of arguments is variable and can be zero
|
Returns a formatted string using the specified format string and arguments. Returns null if a format string contains an illegal syntax, a format specifier that is incompatible with the given arguments, insufficient arguments given the format string, or other illegal conditions.
|
-
#string.format('UserId: %s, Full Name: %s, %s',
'johndoe','John', 'Doe')
-
#string.format('Hex for 10 is %X', 10)
|
-
UserId: johndoe, Full Name: John, Doe
-
Hex for 10 is A
|
String uuidAsBase64Guid(String
<input>, String
<defaultIfNullOrInvalid>)
-
<input> is a string representation of a UUID. Invalid if not compatible with regex /[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}/
-
<defaultIfNullOrInvalid> is the default value to be used if input is null or not a valid UUID
|
Translates the string representation of a UUID to a GUID in Base64 format. If input is null or not a valid UUID, <defaultIfNullOrInvalid> is returned.
|
-
#string.uuidAsBase64Guid('7754d487-1fc3-4206-9e95-ce012f1586e5',
null)
-
#string.uuidAsBase64Guid('invalid',
'lZkqAJgEv0ueGKboT/JFVg==')
|
-
h9RUd8MfBkKelc4BLxWG5Q==
-
lZkqAJgEv0ueGKboT/JFVg==
|
String firstNonEmpty(String
<value1>, String…
<value2…10>)
|
Returns the first value in the input values which is not empty ('') or null. If all input values are null or empty, then null is returned. There must be at least one input value and the rest are optional. You can enter a maximum of 10 input values.
|
-
#string.firstNonEmpty(null, '', 'firstNonEmpty',
'secondNonEmpty')
-
#string.firstNonEmpty('', '')
|
|
String firstNonBlank(String
<value1>, String…
<value2…10>)
-
<value1> is the input value to test. Can be null, empty or blank.
-
<value2…10> are additional and optional input values to test. Can be null, empty or blank
|
Returns the first value in the input values which is not empty (''), null or whitespace only. If all input values are null, empty or blank then null is returned. There must be at least one input value and the rest are optional. You can enter a maximum of 10 input values.
|
-
#string.firstNonBlank(null, '', ‘ ‘,
'firstNonEmpty', 'secondNonEmpty')
-
#string.firstNonBlank('', ‘ ‘, '')
|
|