Here you can find the source of isStringNumber(String number)
public static boolean isStringNumber(String number)
//package com.java2s; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { public static boolean isStringNumber(String number) { if ((number == null)) { return false; } else {/*from w w w .j av a2 s . com*/ String validator = "\\d+"; Pattern pattern = Pattern.compile(validator); Matcher m = pattern.matcher(number); return m.matches(); } } }