List of utility methods to do String to Number Convert
Boolean | isNumberLetter(String str) is Number Letter Boolean isNoLetter = false; String expr = "^[A-Za-z0-9]+$"; if (str.matches(expr)) { isNoLetter = true; return isNoLetter; |
boolean | isStringNumber(String number) is String Number if ((number == null)) { return false; } else { String validator = "\\d+"; Pattern pattern = Pattern.compile(validator); Matcher m = pattern.matcher(number); return m.matches(); |
boolean | isStringNumberLessThan(String number, int compareInt) is String Number Less Than if (isStringNumber(number)) { int numberAsInt = Integer.valueOf(number); return numberAsInt < compareInt; } else return false; |