Thursday, 9 August 2012

Check if a String is Hex (Java)

    private boolean TestHex(String value) {
        boolean ret;
        try {
            int t = Integer.parseInt(value, 16);
            ret = true;
        } catch (NumberFormatException e) {
            ret = false;
        }
        return (ret);
    }

1 comment: