Android examples for java.lang:Character
is string all Numeric character
import android.text.TextUtils; import android.util.Patterns; import java.util.regex.Pattern; public class Main{ public static boolean isNumeric(String string) { if (string == null) { throw new NullPointerException("The string must not be null!"); }/*w ww . ja v a2 s. c o m*/ final int length = string.length(); if (length == 0) { return false; } for (int i = 0; i < length; ++i) { if (!Character.isDigit(string.charAt(i))) { return false; } } return true; } }