public static int toInteger(String s)
    {
        try
        {
            return Integer.parseInt(s);
        }
        catch (NumberFormatException e)
        {
            // Exception noted so can be ignored.
            e = null;

            return 0;
        }
    }
public static int toInteger(String s)
    {
        try
        {
            return Integer.parseInt(s);
        }
        catch (NumberFormatException e)
        {
            
            e = null;

            return 0;
        }
    }
public static int toInteger ( String s ) { try { return Integer . parseInt ( s ) ; } catch ( NumberFormatException e ) { // Exception noted so can be ignored. e = null ; return 0 ; } }
Converts a string to an integer. The string must be a valid integer or the result will be zero.

@param  s The string to convert.

@return The string as an integer, or 0 if it is not a valid integer.
Converts a string to an integer . The string must be a valid integer or the result will be zero .