String to integer with no exceptions

From Stack Overflow
Revision as of 21:05, 1 February 2009 by BrianEnigma (talk | contribs) (New page: <pre> public static int string2int(String s) { int result = 0; try{ result = Integer.parseInt(s); }catch(Exception e){} return result; ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
    public static int string2int(String s)
    {
        int result = 0;
        try{
            result = Integer.parseInt(s);
        }catch(Exception e){}
        return result;
    }