Java String Parse tryParse(String s, int i)

Here you can find the source of tryParse(String s, int i)

Description

try Parse

License

Creative Commons License

Declaration

public static int tryParse(String s, int i) 

Method Source Code

//package com.java2s;
// This software is distributed under the following license:

public class Main {
    public static int tryParse(String s, int i) {
        try {//from   w  w w .  j  av  a2s . c  om
            return Integer.parseInt(s);
        } catch (Exception e) {
            return i;
        }
    }
}

Related

  1. tryParse(String input, Object defVal)
  2. tryParse(String pValue)
  3. tryParse(String s, double d)
  4. tryParse(String s, Integer defaultValue)
  5. tryParse(String val, int defaultValue)
  6. tryParseToType(Object object, Class clazz)
  7. TryParseUShort(String str, short[] u)