Android examples for java.lang:String Convert
is Number String by regex: [0-9]+
import android.text.TextUtils; import java.math.BigDecimal; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main{ public static boolean isNumberString(String input) { if (!isNullOrEmpty(input)) { if (input.matches("[0-9]+")) { return true; }/* w w w .ja v a 2s .c o m*/ } return false; } }