Apache Commons Lang provides org.apache.commons.lang.StringUtils.isNumeric(CharSequence cs)
, which takes as an argument a String
and checks if it consists of purely numeric characters (including numbers from non-Latin scripts). That method returns false
if there are characters such as space, minus, plus, and decimal separators such as comma and dot.
Other methods of that class allow for further numeric checks.