Skip to content

StringUtils.isAlphanumeric

Signature: StringUtils.isAlphanumeric(inputString)

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

Checks if the inputString contains only letters or digits. 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.isAlphanumeric('SPACES ARE NOT ALPHANUMERIC 24324');                    // false
StringUtils.isAlphanumeric('IFALLTHELETTERSARE723492929alphaNumericRETURNTRUE');    // true