Java Integer Create toInteger(String s, int defValue)

Here you can find the source of toInteger(String s, int defValue)

Description

to Integer

License

Apache License

Declaration

public static int toInteger(String s, int defValue) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static int toInteger(String s, int defValue) {
        Integer result = toInteger(s);
        return ((result != null) ? result.intValue() : defValue);
    }//from  w w w.j av a  2  s .  c  o m

    public static Integer toInteger(String s) {
        if (s != null)
            try {
                return Integer.valueOf(s);
            } catch (NumberFormatException e) {
            }
        return null;
    }
}

Related

  1. toInteger(String numericString)
  2. toInteger(String pString)
  3. ToInteger(String s)
  4. toInteger(String s)
  5. toInteger(String s)
  6. toInteger(String str)
  7. toInteger(String str)
  8. toInteger(String str)
  9. toInteger(String string)