Skip to content

StringUtils.isNumeric

Signature: StringUtils.isNumeric(inputString)

Returns: Boolean result - true if inputString contains only digits or is empty

Checks if the inputString contains only digits. A decimal point is not a digit and returns false. null will return false. An empty ("") string will return true.

Parameters

Type Name Description Default
String inputString the String to check, may be null

Example

StringUtils.isNumeric('This is not numeric');   // false
StringUtils.isNumeric('307.23');                // false (Decimal point makes this non-numeric) */
StringUtils.isNumeric('9899');                  // true