Android examples for java.lang:String
is string all Number by ASCII code
import android.text.TextUtils; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isNumber(String validString) { byte tempbyte[] = validString.getBytes(); for (int i = 0; i < validString.length(); i++) { if (tempbyte[i] < 48 || tempbyte[i] > 57) { return false; }/* w ww. ja v a 2s . c o m*/ } return true; } }