Here you can find the source of isStringNumberLessThan(String number, int compareInt)
public static boolean isStringNumberLessThan(String number, int compareInt) throws NumberFormatException
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isStringNumberLessThan(String number, int compareInt) throws NumberFormatException { //no need for this but.... if (isStringNumber(number)) { int numberAsInt = Integer.valueOf(number); return numberAsInt < compareInt; } else//from www . j av a2 s .c om return false; } public static boolean isStringNumber(String number) { if ((number == null)) { return false; } else { String validator = "\\d+"; Pattern pattern = Pattern.compile(validator); Matcher m = pattern.matcher(number); return m.matches(); } } }