Gotcha: Using Apache Commons StringUtils.isNumeric
StringUtils java class in Apache commons library provides a method isNumeric to check if given sequence of characters contains digits only. But this is not a sure shot way to check for numbers because for a string containing decimal the StringUtils.isNumeric returns false as shown below: A better approach is to use NumberUtils.isCreatable which adopts … Read more