Here you can find the source of isNumber(String number)
public static boolean isNumber(String number)
//package com.java2s; import java.util.regex.Pattern; public class Main { private static final Pattern NUMBER_REG = Pattern.compile("^\\d+$"); public static boolean isNumber(String number) { return NUMBER_REG.matcher(number).matches(); }//from w w w. j ava2 s. com }