Java String to Int asInteger(String v)

Here you can find the source of asInteger(String v)

Description

as Integer

License

Apache License

Declaration

public static Integer asInteger(String v) 

Method Source Code

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

public class Main {
    public static Integer asInteger(String v) {
        try {//from w  w  w .j a  v  a2s.  co m
            return (v != null) ? Integer.valueOf(v) : null;
        } catch (NumberFormatException ex) {
            return null;
        }
    }
}

Related

  1. asInt(String str, int defaultValue)
  2. asInt(String sval, int dflt)
  3. asInt(String value)
  4. asInteger(String param)
  5. asInteger(String string)
  6. asInteger(String value)
  7. asInteger(String value)
  8. convertStringToInt(final String str)
  9. convertStringToInt(final String strNumber)