Java tutorial
//package com.java2s; public class Main { public static boolean isNumericString(String s) { boolean b = true; for (int i = 0; i < s.length(); i++) { if (!isNumeric(s.charAt(i))) { b = false; break; } } return b; } public static boolean isNumeric(char c) { return (c >= '0' && c <= '9'); } }