Sunday, August 11, 2013

Java Check Number Value

public boolean checkIfNumber(String in) {

        try {

            Integer.parseInt(in);

        } catch (NumberFormatException ex) {
            return false;
        }

        return true;
    }

No comments:

Post a Comment