Here you can find the source of isDecimal(String str)
public static boolean isDecimal(String str)
//package com.java2s; import java.util.regex.Pattern; public class Main { public static boolean isDecimal(String str) { return Pattern.compile("[\\d]").matcher(str).matches(); }//from w w w.j a va2 s . co m }