Posted By: Anonymous
How would you check if a String was a number before parsing it?
You can also use
StringUtils.isNumericSpace which returns
true for empty strings and ignores internal spaces in the string. Another way is to use
NumberUtils.isParsable which basically checks the number is parsable according to Java. (The linked javadocs contain detailed examples for each method.)