java check if able to parse int

109

java check if able to parse int -

public static boolean isParsable(String input) {
    try {
        Integer.parseInt(input);
        return true;
    } catch (final NumberFormatException e) {
        return false;
    }
}

Comments

Submit
0 Comments