Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java how to check string is number

public static boolean isNumeric(String strNum) {
    if (strNum == null) {
        return false;
    }
    try {
        double d = Double.parseDouble(strNum);
    } catch (NumberFormatException nfe) {
        return false;
    }
    return true;
}
Source by www.baeldung.com #
 
PREVIOUS NEXT
Tagged: #java #check #string #number
ADD COMMENT
Topic
Name
2+2 =