Android Utililty Methods String to Number Convert

List of utility methods to do String to Number Convert

Description

The list of methods to do String to Number Convert are organized into topic(s).

Method

BooleanisNumberLetter(String str)
is Number Letter
Boolean isNoLetter = false;
String expr = "^[A-Za-z0-9]+$";
if (str.matches(expr)) {
    isNoLetter = true;
return isNoLetter;
booleanisStringNumber(String number)
is String Number
if ((number == null)) {
    return false;
} else {
    String validator = "\\d+";
    Pattern pattern = Pattern.compile(validator);
    Matcher m = pattern.matcher(number);
    return m.matches();
booleanisStringNumberLessThan(String number, int compareInt)
is String Number Less Than
if (isStringNumber(number)) {
    int numberAsInt = Integer.valueOf(number);
    return numberAsInt < compareInt;
} else
    return false;