Functions: FnString

1. Overview

FnString is a function hub class containing a lot of static methods returning functions that take a String object as its input. It includes conversions to numbers, calendar and escape functions among others.

2. Functions

Function nameTypeParamsDescription
asciifyFunction<String,String>

ASCIIfies a String containing text in (mainly) European languages by removing a set of recognized diacritic symbols and performing a number of transformations. Calling this method is equivalent to calling asciify(AsciifyMode) using the DEFAULT mode.

asciifyFunction<String,String>AsciifyMode mode

ASCIIfies a String containing text in (mainly) European languages by removing a set of recognized diacritic symbols and performing a number of transformations, determined by the AsciifyMode parameter.

Transformations for AsciifyMode.DEFAULT are:

  • À, Á, Â, Ã, Ä, Å, \u0100, \u0102, \u0104, \u01CD, \u01FA / à, á, â, ã, ä, å, \u0101, \u0103, \u0105, \u01CE, \u01FB = A / a
  • Æ, \u01FC / æ, \u01FD = AE / ae
  • Ç, \u0106, \u0108, \u010A, \u010C / ç, \u0107, \u0109, \u010B, \u010D = C / c
  • Ð, \u010E, \u0110 / ð, \u010F, \u0111 = D / d
  • È, É, Ê, Ë, \u0112, \u0114, \u0116, \u0118, \u011A / è, é, ê, ë, \u0113, \u0115, \u0117, \u0119, \u011B = E / e
  • \u011C, \u011E, \u0120, \u0122 / \u011D, \u011F, \u0121, \u0123 = G / g
  • \u0124, \u0126 / \u0125, \u0127 = H / h
  • Ì, Í, Î, Ï, \u0128, \u012A, \u012C, \u012E, \u0130, \u01CF / ì, í, î, ï, \u0129, \u012B, \u012D, \u012F, \u0131, \u01D0 = I / i
  • \u0132 / \u0133 = IJ / ij
  • \u0134 / \u0135 = J / j
  • \u0136 / \u0137, \u0138 = K / k
  • \u0139, \u013B, \u013D, \u013F, \u0141 / \u013A, \u013C, \u013E, \u0140, \u0142 = L / l
  • Ñ, \u0143, \u0145, \u0147, \u014A / ñ, \u0144, \u0146, \u0148, \u0149, \u014B = N / n
  • Ò, Ó, Ô, Õ, Ö, Ø, \u014C, \u014E, \u0150, \u01A0, \u01D1, \u01FE / ò, ó, ô, õ, ö, ø, \u014D, \u014F, \u0151, \u01A1, \u01D2, \u01FF = O / o
  • \u0152 / \u0153 = OE / oe
  • \u0154, \u0156, \u0158 / \u0155, \u0157, \u0159 = R / r
  • \u015A, \u015C, \u015E, \u0160 / \u015B, \u015D, \u015F, \u0161 = S / s
  • ß = "ss" if the preceding character is lower case, "SS" otherwise.
  • \u0162, \u0164, \u0166 / \u0163, \u0165, \u0167 = T / t
  • Þ / þ = TH / th
  • Ù, Ú, Û, Ü, \u0168, \u016A, \u016C, \u016E, \u0170, \u0172, \u01AF, \u01D3, \u01D5, \u01D7, \u01D9, \u01DB / ù, ú, û, ü, \u0169, \u016B, \u016D, \u016F, \u0171, \u0173, \u01B0, \u01D4, \u01D6, \u01D8, \u01DA, \u01DC = U / u
  • \u0174 / \u0175 = W / w
  • Ý, \u0178, \u0176 / ý, ÿ, \u0177 = Y / y
  • \u0179, \u017B, \u017D / \u017A, \u017C, \u017E = Z / z

Transformations for AsciifyMode.UMLAUT_E are the same as DEFAULT with the following differences:

  • Ä / ä = AE / ae
  • Ö / ö = OE / oe
  • Ü / ü = UE / ue
capitalizeFunction<String,String>

Converts the first letter of each word in the target String to upper case.

containsFunction<String,Boolean>String regex

Determines whether the target String contains a fragment matching the specified regular expression.

Regular expressions must conform to the java.util.regex.Pattern format.

endsWithFunction<String, Boolean>String suffix

Checkx whether the input String ends with the specified suffix or not. If the suffix is empty, ends with or is equal to the input, it will return true.

eqFunction<Object,Boolean>String object

Performs an equals operation between the target object and the specified one.

escapeCSVFunction<String,String>

Turns a String into a value valid for being a CSV column value, enclosed in double quotes if needed.

This method calls org.apache.commons.lang.StringUtils.escapeCsv(). From its definition:

  • If the value contains a comma, newline or double quote, then the String value is written enclosed in double quotes.
  • Any double quote characters in the value are escaped with another double quote.
  • If the value does not contain a comma, newline or double quote, then the String value is written unchanged (null values are ignored).
escapeHTMLFunction<String,String>

Escapes the characters in a String using HTML entities.

This method calls org.apache.commons.lang.StringUtils.escapeHtml(). From its definition:

  • The string "bread" & "butter" becomes &quot;bread&quot; &amp; &quot;butter&quot;.
  • Supports all known HTML 4.0 entities, including funky accents. Note that the commonly used apostrophe escape character (&apos;) is not a legal entity and so is not supported).
escapeJavaScriptFunction<String,String>

Escapes the characters in a String using JavaScript String rules.

This method calls org.apache.commons.lang.StringUtils.escapeJavascript(). From its definition:

  • Escapes any values it finds into their JavaScript String form. Deals correctly with quotes and control-chars (tab, backslash, cr, ff, etc.)
  • So a tab becomes the characters '\\' and 't'.
  • The only difference between Java strings and JavaScript strings is that in JavaScript, a single quote must be escaped.

Example:

  • input string: He didn't say, "Stop!"
  • output string: He didn\'t say, \"Stop!\"
escapeXMLFunction<String,String>

Escapes the characters in a String using XML entities.

This method calls org.apache.commons.lang.StringUtils.escapeXml(). From its definition:

  • For example: "bread" & "butter" => &quot;bread&quot; &amp; &quot;butter&quot;.
  • Supports only the five basic XML entities (gt, lt, quot, amp, apos). Does not support DTDs or external entities.
  • Note that unicode characters greater than 0x7f are currently escaped to their numerical \\u equivalent. This may change in future releases.
extractAllFunction<String,List<String>>String regex

Extracts every substring from the target String that match the specified regular expression.

Regular expressions must conform to the java.util.regex.Pattern format.

extractFirstFunction<String,String>String regex

Extracts the first substring from the target String that matches the specified regular expression.

Regular expressions must conform to the java.util.regex.Pattern format.

extractLastFunction<String,String>String regex

Extracts the last substring from the target String that matches the specified regular expression.

Regular expressions must conform to the java.util.regex.Pattern format.

fromHexadecimalFunction<String,String>Charset charset

Converts the target String from the Hexadecimal representation of its bytes back into a String using the specified Charset.

greaterOrEqToFunction<Object,Boolean>String object

Determines whether the target object is greater or equal to the specified object in value, this is, whether target.compareTo(object) >= 0. Both the target and the specified object have to implement Comparable.

greaterThanFunction<Object,Boolean>String object

Determines whether the target object is greater than the specified object in value, this is, whether target.compareTo(object) > 0. Both the target and the specified object have to implement Comparable.

isAlphaFunction<String, Boolean>

Checks if a String contains only unicode letters or not

isAlphaSpaceFunction<String, Boolean>

Checks if a String contains only unicode letters and spaces or not

isBigDecimalFunction<String,Boolean>

Returns true if the input String can be converted into a valid BigDecimal. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not.

isBigDecimalFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid BigDecimal in the given Locale

isBigDecimalFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid BigDecimal in the given Locale specified as a String

isBigDecimalFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid BigDecimal using the specified decimal point configuration ( DecimalPoint).

isBigIntegerFunction<String,Boolean>

Returns true if the input String can be converted into a valid BigInteger. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not.

isBigIntegerFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid BigInteger in the given Locale

isBigIntegerFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid BigInteger in the given Locale specified as a String

isBigIntegerFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid BigInteger using the specified decimal point configuration ( DecimalPoint).

isBigIntegerFunction<String,Boolean>int radix

Returns true if the input String can be converted into a valid BigInteger in the specified radix. It uses the default configuration to check the String

isBlankFunction<String, Boolean>

Returns whether the target String is blank or not. It calls StringUtils#isBlank(String). The string is blank if it is whitespace, empty ("") or null.

isByteFunction<String,Boolean>

Returns true if the input String can be converted into a valid Byte. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not. If this method returns false, FnString#toByte() will throw an exception if called.

isByteFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid Byte in the given Locale. If this method returns false, FnString#toByte(Locale) will throw an exception if called.

isByteFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid Byte in the given Locale specified as a String. If this method returns false, FnString#toByte(String) will throw an exception if called.

isByteFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid Byte using the specified decimal point configuration ( DecimalPoint). If this method returns false, FnString#toByte(DecimalPoint) will throw an exception if called.

isByteFunction<String,Boolean>int radix

Returns true if the input String can be converted into a valid Byte in the specified radix. It uses the default configuration to check the String. If this method returns false, FnString#toByte(int) will throw an exception if called.

isCalendarFunction<String,Boolean>String pattern

Checks whether the target String can be converted into a Calendar based on the input parameters or not. If it returns true, FnString#toCalendar(String) can be called safely.

Pattern format is that of java.text.SimpleDateFormat.

isCalendarFunction<String,Boolean>String pattern
Locale locale

Checks whether the target String represents a Calendar or not. If it returns true, FnString#toCalendar(String, Locale) can be called safely.

Pattern format is that of java.text.SimpleDateFormat.

isCalendarFunction<String,Boolean>String pattern
String locale

Returns true if the target String can be converted into a Calendar based on the input parameters. If it returns true, the function ToCalendar#ToCalendar(String, String) can be called safely.

Pattern format is that of java.text.SimpleDateFormat.

isDoubleFunction<String,Boolean>

Returns true if the input String can be converted into a valid Double. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not. If this method returns false, FnString#toDouble() will throw an exception if called.

isDoubleFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid Double in the given Locale. If this method returns false, FnString#toDouble(Locale) will throw an exception if called.

isDoubleFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid Double in the given Locale specified as a String. If this method returns false, FnString#toDouble(String) will throw an exception if called.

isDoubleFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid Double using the specified decimal point configuration ( DecimalPoint). If this method returns false, FnString#toDouble(DecimalPoint) will throw an exception if called.

isEmptyFunction<String, Boolean>

Returns whether the target String is empty or not. It calls StringUtils#isEmpty(String). The string is empty if it is "" or null

isFloatFunction<String,Boolean>

Returns true if the input String can be converted into a valid Float. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not. If this method returns false, FnString#isFloat() will throw an exception if called.

isFloatFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid Float in the given Locale. If this method returns false, FnString#isFloat(Locale) will throw an exception if called.

isFloatFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid Float in the given Locale specified as a String. If this method returns false, FnString#isFloat(String) will throw an exception if called.

isFloatFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid Float using the specified decimal point configuration ( DecimalPoint). If this method returns false, FnString#isFloat(DecimalPoint) will throw an exception if called.

isIntegerFunction<String,Boolean>

Returns true if the input String can be converted into a valid Integer. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not. If this method returns false, FnString#isInteger() will throw an exception if called.

isIntegerFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid Integer in the given Locale. If this method returns false, FnString#isInteger(Locale) will throw an exception if called.

isIntegerFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid Integer in the given Locale specified as a String. If this method returns false, FnString#isInteger(String) will throw an exception if called.

isIntegerFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid Integer using the specified decimal point configuration ( DecimalPoint). If this method returns false, FnString#isInteger(DecimalPoint) will throw an exception if called.

isIntegerFunction<String,Boolean>int radix

Returns true if the input String can be converted into a valid Integer in the specified radix. It uses the default configuration to check the String. If this method returns false, FnString#isInteger(int) will throw an exception if called.

isLongFunction<String,Boolean>

Returns true if the input String can be converted into a valid Long. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not. If this method returns false, FnString#isLong() will throw an exception if called.

isLongFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid Long in the given Locale. If this method returns false, FnString#isLong(Locale) will throw an exception if called.

isLongFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid Long in the given Locale specified as a String. If this method returns false, FnString#isLong(String) will throw an exception if called.

isLongFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid Long using the specified decimal point configuration ( DecimalPoint). If this method returns false, FnString#isLong(DecimalPoint) will throw an exception if called.

isLongFunction<String,Boolean>int radix

Returns true if the input String can be converted into a valid Long in the specified radix. It uses the default configuration to check the String. If this method returns false, FnString#isLong(int) will throw an exception if called.

isNotNullFunction<Object,Boolean>

Determines whether the target object is null or not.

isNullFunction<Object,Boolean>

Determines whether the target object is null or not.

isNumericFunction<String, Boolean>

Checks if a String contains only unicode digits or not

isNumericSpaceFunction<String, Boolean>

Checks if a String contains only unicode digits and spaces or not

isShortFunction<String,Boolean>

Returns true if the input String can be converted into a valid Short. It uses the default configuration from the JVM (en_US) to check whether the string is valid or not. If this method returns false, FnString#isShort() will throw an exception if called.

isShortFunction<String,Boolean>Locale locale

Returns true if the input String can be converted into a valid Short in the given Locale. If this method returns false, FnString#isShort(Locale) will throw an exception if called.

isShortFunction<String,Boolean>String locale

Returns true if the input String can be converted into a valid Short in the given Locale specified as a String. If this method returns false, FnString#isShort(String) will throw an exception if called.

isShortFunction<String,Boolean>DecimalPoint decimalPoint

Returns true if the input String can be converted into a valid Short using the specified decimal point configuration ( DecimalPoint). If this method returns false, FnString#isShort(DecimalPoint) will throw an exception if called.

isShortFunction<String,Boolean>int radix

Returns true if the input String can be converted into a valid Short in the specified radix. It uses the default configuration to check the String. If this method returns false, FnString#isShort(int) will throw an exception if called.

joinFunction<List<Object>, String>

Joins the string representation of the objects in the list (which might be Strings themselves) into a single String (no separator used).

joinFunction<List<Object>, String>String separator

Joins the string representation of the objects in the list (which might be Strings themselves) into a single String using the given separator.

joinArrayFunction<Object[], String>

Joins the string representation of the objects in the array (which might be Strings themselves) into a single String (no separator used).

joinArrayFunction<Object[], String>String separator

Joins the string representation of the objects in the array (which might be Strings themselves) into a single String using the given separator.

lessOrEqToFunction<Object,Boolean>String object

Determines whether the target object is less or equal to the specified object in value, this is, whether target.compareTo(object) <= 0. Both the target and the specified object have to implement Comparable.

lessThanFunction<Object,Boolean>String object

Determines whether the target object is less than the specified object in value, this is, whether target.compareTo(object) < 0. Both the target and the specified object have to implement Comparable.

matchAndExtractFunction<String,String>String regex
int group

Matches the entire target String against the specified regular expression and extracts the specified group from it (as specified by java.util.regex.Matcher.

Regular expressions must conform to the java.util.regex.Pattern format.

matchAndExtractAllFunction<String,List<String>>String regex
int... groups

Matches the entire target String against the specified regular expression and extracts the specified groups from it (as specified by java.util.regex.Matcher.

Regular expressions must conform to the java.util.regex.Pattern format.

matchesFunction<String,Boolean>String regex

Determines whether the target String matches the specified regular expression.

Regular expressions must conform to the java.util.regex.Pattern format.

notEqFunction<Object,Boolean>String object

Performs an inverse equals operation between the target object and the specified one.

replaceAllFunction<String,String>String regex
String replacement

Replaces in the target String all substrings matching the specified regular expression with the specified replacement String.

Regular expressions must conform to the java.util.regex.Pattern format.

replaceFirstFunction<String,String>String regex
String replacement

Replaces in the target String the first substring matching the specified regular expression with the specified replacement String.

Regular expressions must conform to the java.util.regex.Pattern format.

replaceLastFunction<String,String>String regex
String replacement

Replaces in the target String the last substring matching the specified regular expression with the specified replacement String.

Regular expressions must conform to the java.util.regex.Pattern format.

reverseFunction<String, String>

It reverses the input String

splitFunction<String, List<String>>

Splits a String into a list of substrings using a whitespace as a separator.

splitFunction<String, List<String>>String separator

Splits a String into a list of substrings using the given separator as a substrings separator (the separator is not included in the elements of the returned list).

splitAsArrayFunction<String, String[]>

Splits a String into an array of substrings using a whitespace as a separator.

splitAsArrayFunction<String, String[]>String separator

Splits a String into an array of substrings using the given separator as a substrings separator (the separator is not included in the elements of the returned array).

startsWithFunction<String, Boolean>String prefix

It checks whether the input String starts with the specified prefix or not. If the suffix is empty, starts with or is equal to the input, it will return true.

startsWithFunction<String, Boolean>String prefix
int offset

It checks whether the input substring after the given offset starts with the given prefix or not.

stripFunction<String,String>

Strips whitespace from both sides of the target String.

substringFunction<String, String>int start

Returns the substring of input from start position (null if null String input). It calls StringUtils#substring(String, int)

substringFunction<String, String>int start
int end

Returns the substring of input from start position to end position (null if null String input). It calls StringUtils#substring(String, int, int)

substringAfterFunction<String, String>String separator

Returns the substring after the first occurrence of the given separator. It calls StringUtils#substringAfter(String, String)

substringAfterLastFunction<String, String>String separator

Returns the substring after the last occurrence of the given separator. It calls StringUtils#substringAfterLast(String, String)

substringBeforeFunction<String, String>String separator

Returns the substring before the first occurrence of the given separator. It calls StringUtils#substringBefore(String, String)

substringBeforeLastFunction<String, String>String separator

Returns the substring before the last occurrence of the given separator. It calls StringUtils#substringBeforeLast(String, String)

substringBetweenFunction<String, String>String tag

Returns the substring between tag and tag or null if there is no match. It calls StringUtils#substringBetween(String, String)

substringBetweenFunction<String, String>String open
String close

Returns the substring between open and close or null if there is no match. It calls StringUtils#substringBetween(String, String, String)

toBigDecimalFunction<String,BigDecimal>

Converts a String into a BigDecimal, using the default configuration for for decimal point and precision.

toBigDecimalFunction<String,BigDecimal>Locale locale

Converts a String into a BigDecimal, using the specified locale for decimal point and thousands separator configuration.

toBigDecimalFunction<String,BigDecimal>String locale

Converts a String into a BigDecimal, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.)

toBigDecimalFunction<String,BigDecimal>DecimalPoint decimalPoint

Converts a String into a BigDecimal, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators.

toBigDecimalFunction<String,BigDecimal>int scale
RoundingMode roundingMode

Converts a String into a BigDecimal, using the default configuration for for decimal point and thousands separator and establishing the specified scale. Rounding mode is used for setting the scale to the specified value.

toBigDecimalFunction<String,BigDecimal>int scale
RoundingMode roundingMode
Locale locale

Converts a String into a BigDecimal, using the specified locale for decimal point and thousands separator configuration and establishing the specified scale. Rounding mode is used for setting the scale to the specified value.

toBigDecimalFunction<String,BigDecimal>int scale
RoundingMode roundingMode
String locale

Converts a String into a BigDecimal, using the specified locale for decimal point and thousands separator configuration and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. Locale is specified as a String (for example: "en_US", "es_ES", etc.)

toBigDecimalFunction<String,BigDecimal>int scale
RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a BigDecimal, using the specified decimal point configuration ( DecimalPoint) and establishing the specified scale. Rounding mode is used for setting the scale to the specified value.. The target String should contain no thousand separators.

toBigIntegerFunction<String,BigInteger>

Converts a String into a BigInteger, using the default configuration. Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>Locale locale

Converts a String into a BigInteger, using the specified locale for decimal point and thousands separator configuration. Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>String locale

Converts a String into a BigInteger, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>DecimalPoint decimalPoint

Converts a String into a BigInteger, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>int radix

Converts a String into a BigInteger, using the specified radix for computing the equivalent number. The input String must be a valid BigInteger in the given radix (i.e. if radix is 5, 34 would be a valid input whereas 34.3 wouldn't as '.' is not allowed).

toBigIntegerFunction<String,BigInteger>RoundingMode roundingMode

Converts a String into a BigInteger, using the default configuration for for decimal point and thousands separator. Rounding mode is used for removing the decimal part of the number. Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a BigInteger, using the specified decimal point configuration ( DecimalPoint). Rounding mode is used for removing the decimal part of the number. The target String should contain no thousand separators. Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>RoundingMode roundingMode
Locale locale

Converts a String into a BigInteger, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. Any fractional part of the input String will be removed.

toBigIntegerFunction<String,BigInteger>RoundingMode roundingMode
String locale

Converts a String into a BigInteger, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. Locale is specified as a String (for example: "en_US", "es_ES", etc.). Any fractional part of the input String will be removed.

toBooleanFunction<String,Boolean>

Converts a String into a Boolean. Case is ignored, and all three "true"/"false", "yes"/"no" and "on"/"off" versions are supported.

This method calls org.apache.commons.lang.StringUtils.toBooleanObject().

toByteFunction<String,Byte>

Converts a String into a Byte, using the default configuration. Any fractional part of the input String will be removed. The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>Locale locale

Converts a String into a Byte, using the specified locale for decimal point and thousands separator configuration. The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>String locale

Converts a String into a Byte, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>DecimalPoint decimalPoint

Converts a String into a Byte, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>int radix

Converts a String into a Byte, using the specified radix for computing the equivalent number. The input String must be a valid Byte in the given radix

toByteFunction<String,Byte>RoundingMode roundingMode

Converts a String into a Byte, using the default configuration for for decimal point and thousands separator. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a Byte, using the specified decimal point configuration ( DecimalPoint). Rounding mode is used for removing the decimal part of the number. The target String should contain no thousand separators. The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>RoundingMode roundingMode
Locale locale

Converts a String into a Byte, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toByteFunction<String,Byte>RoundingMode roundingMode
String locale

Converts a String into a Byte, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Byte#MIN_VALUE and Byte#MAX_VALUE

toCalendarFunction<String,Calendar>String pattern

Converts the target String to a java.util.Calendar by applying the specified pattern.

Pattern format is that of java.text.SimpleDateFormat.

toCalendarFunction<String,Calendar>String pattern
Locale locale

Converts the target String to a java.util.Calendar by applying the specified pattern and locale. The locale is needed for correctly parsing month names.

Pattern format is that of java.text.SimpleDateFormat.

toCalendarFunction<String,Calendar>String pattern
String locale

Converts the target String to a java.util.Calendar by applying the specified pattern and locale. The locale is needed for correctly parsing month names.

Pattern format is that of java.text.SimpleDateFormat.

toDateFunction<String,Date>String pattern

Converts the target String to a java.util.Date by applying the specified pattern.

Pattern format is that of java.text.SimpleDateFormat.

toDateFunction<String,Date>String pattern
Locale locale

Converts the target String to a java.util.Date by applying the specified pattern and locale. The locale is needed for correctly parsing month names.

Pattern format is that of java.text.SimpleDateFormat.

toDateFunction<String,Date>String pattern
String locale

Converts the target String to a java.util.Date by applying the specified pattern and locale. The locale is needed for correctly parsing month names.

Pattern format is that of java.text.SimpleDateFormat.

toDoubleFunction<String,Double>

Converts a String into a Double, using the default configuration for for decimal point and precision. The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>Locale locale

Converts a String into a Double, using the specified locale for decimal point and thousands separator configuration. The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>String locale

Converts a String into a Double, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>DecimalPoint decimalPoint

Converts a String into a Double, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>int scale
RoundingMode roundingMode

Converts a String into a Double, using the default configuration for for decimal point and thousands separator and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>int scale
RoundingMode roundingMode
Locale locale

Converts a String into a Double, using the specified locale for decimal point and thousands separator configuration and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>int scale
RoundingMode roundingMode
String locale

Converts a String into a Double, using the specified locale for decimal point and thousands separator configuration and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toDoubleFunction<String,Double>int scale
RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a Double, using the specified decimal point configuration ( DecimalPoint) and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. The input string must be between Double#MIN_VALUE and Double#MAX_VALUE

toFloatFunction<String,Float>

Converts a String into a Float, using the default configuration for for decimal point and precision. The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>Locale locale

Converts a String into a Float, using the specified locale for decimal point and thousands separator configuration. The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>String locale

Converts a String into a Float, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>DecimalPoint decimalPoint

Converts a String into a Float, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>int scale
RoundingMode roundingMode

Converts a String into a Float, using the default configuration for for decimal point and thousands separator and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>int scale
RoundingMode roundingMode
Locale locale

Converts a String into a Float, using the specified locale for decimal point and thousands separator configuration and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>int scale
RoundingMode roundingMode
String locale

Converts a String into a Float, using the specified locale for decimal point and thousands separator configuration and establishing the specified scale. Rounding mode is used for setting the scale to the specified value. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toFloatFunction<String,Float>int scale
RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a Float, using the specified decimal point configuration ( DecimalPoint) and establishing the specified scale. Rounding mode is used for setting the scale to the specified value.. The target String should contain no thousand separators. The input string must be between Float#MIN_VALUE and Float#MAX_VALUE

toHexadecimalFunction<String,String>Charset charset

Converts the target String into the Hexadecimal representation of its bytes using the specified Charset to obtain them (the bytes).

toIntegerFunction<String,Integer>

Converts a String into an Integer, using the default configuration. The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>Locale locale

Converts a String into an Integer, using the specified locale for decimal point and thousands separator configuration. The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>String locale

Converts a String into an Integer, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>DecimalPoint decimalPoint

Converts a String into an Integer, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>int radix

Converts a String into an Integer, using the specified radix for computing the equivalent number. The input String must be a valid Integer in the given radix (i.e. if radix is 5, 34 would be a valid input whereas 34.3 wouldn't as '.' is not allowed)

toIntegerFunction<String,Integer>RoundingMode roundingMode

Converts a String into an Integer, using the default configuration for for decimal point and thousands separator. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into an Integer, using the specified decimal point configuration ( DecimalPoint). Rounding mode is used for removing the decimal part of the number. The target String should contain no thousand separators. The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>RoundingMode roundingMode
Locale locale

Converts a String into an Integer, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toIntegerFunction<String,Integer>RoundingMode roundingMode
String locale

Converts a String into an Integer, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Integer#MIN_VALUE and Integer#MAX_VALUE

toLongFunction<String,Long>

Converts a String into a Long, using the default configuration. The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>Locale locale

Converts a String into a Long, using the specified locale for decimal point and thousands separator configuration. The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>String locale

Converts a String into a Long, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>DecimalPoint decimalPoint

Converts a String into a Long, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>int radix

Converts a String into a Long, using the specified radix for computing the equivalent number. The input String must be a valid Long in the given radix (i.e. if radix is 5, 34 would be a valid input whereas 34.3 wouldn't as '.' is not allowed)

toLongFunction<String,Long>RoundingMode roundingMode

Converts a String into a Long, using the default configuration for for decimal point and thousands separator. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a Long, using the specified decimal point configuration ( DecimalPoint). Rounding mode is used for removing the decimal part of the number. The target String should contain no thousand separators. The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>RoundingMode roundingMode
Locale locale

Converts a String into a Long, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLongFunction<String,Long>RoundingMode roundingMode
String locale

Converts a String into a Long, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Long#MIN_VALUE and Long#MAX_VALUE

toLowerCaseFunction<String,String>

Converts the target String to lower case.

toShortFunction<String,Short>

Converts a String into a Short, using the default configuration. The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>Locale locale

Converts a String into a Short, using the specified locale for decimal point and thousands separator configuration. The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>String locale

Converts a String into a Short, using the specified locale for decimal point and thousands separator configuration. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>DecimalPoint decimalPoint

Converts a String into a Short, using the specified decimal point configuration ( DecimalPoint). The target String should contain no thousand separators. The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>int radix

Converts a String into a Short, using the specified radix for computing the equivalent number. The input String must be a valid Short in the given radix (i.e. if radix is 5, 34 would be a valid input whereas 34.3 wouldn't as '.' is not allowed)

toShortFunction<String,Short>RoundingMode roundingMode

Converts a String into a Short, using the default configuration for for decimal point and thousands separator. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>RoundingMode roundingMode
DecimalPoint decimalPoint

Converts a String into a Short, using the specified decimal point configuration ( DecimalPoint). Rounding mode is used for removing the decimal part of the number. The target String should contain no thousand separators. The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>RoundingMode roundingMode
Locale locale

Converts a String into a Short, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toShortFunction<String,Short>RoundingMode roundingMode
String locale

Converts a String into a Short, using the specified locale for determining decimal point. Rounding mode is used for removing the decimal part of the number. Locale is specified as a String (for example: "en_US", "es_ES", etc.). The integer part of the input string must be between Short#MIN_VALUE and Short#MAX_VALUE

toUpperCaseFunction<String,String>

Converts the target String to upper case.

trimFunction<String,String>

Removes control characters (char <= 32) from both ends of the target String.

unCapitalizeFunction<String,String>

Converts the first letter of each word in the target String to lowercase

unescapeCSVFunction<String,String>

Removes escaping from a String escaped for a CSV column.

This method calls org.apache.commons.lang.StringUtils.unescapeCsv(). From its definition:

  • Returns a String value for an unescaped CSV column.
  • If the value is enclosed in double quotes, and contains a comma, newline or double quote, then quotes are removed.
  • Any double quote escaped characters (a pair of double quotes) are unescaped to just one double quote.
  • If the value is not enclosed in double quotes, or is and does not contain a comma, newline or double quote, then the String value is returned unchanged.
unescapeHTMLFunction<String,String>

Unescapes a string containing entity escapes to a string containing the actual Unicode characters corresponding to the escapes. Supports HTML 4.0 entities.

This method calls org.apache.commons.lang.StringUtils.unescapeHtml(). From its definition:

  • The string &lt;Fran&ccedil;ais&gt; will become <Franais>
  • If an entity is unrecognized, it is left alone, and inserted verbatim into the result string. e.g. &gt;&zzzz;x will become >&zzzz;x.
unescapeJavaScriptFunction<String,String>

Unescapes any JavaScript literals found in the String.

For example, it will turn a sequence of '\' and 'n' into a newline character, unless the '\' is preceded by another '\'.

This method calls org.apache.commons.lang.StringUtils.unescapeJavascript().

unescapeXMLFunction<String,String>

Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes.

This method calls org.apache.commons.lang.StringUtils.unescapeXml(). From its definition:

  • Supports only the five basic XML entities (gt, lt, quot, amp, apos). Does not support DTDs or external entities.
  • Note that numerical \\u unicode codes are unescaped to their respective unicode characters. This may change in future releases.