String to integer with no exceptions

From Stack Overflow
Jump to: navigation, search
    public static int string2int(String s)
    {
        int result = 0;
        try{
            result = Integer.parseInt(s);
        }catch(Exception e){}
        return result;
    }

Personal tools