Java String to Int asInt(String str)

Here you can find the source of asInt(String str)

Description

as Int

License

LGPL

Declaration

private static int asInt(String str) 

Method Source Code

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

public class Main {
    private static int asInt(String str) {
        try {//from w w w .ja v  a  2 s .  co  m
            return Integer.valueOf(str);
        } catch (NumberFormatException nfex) {
            return Integer.MIN_VALUE;
        }
    }
}

Related

  1. asInt(String number)
  2. asInt(String str)
  3. asInt(String str, int defaultValue)
  4. asInt(String sval, int dflt)
  5. asInt(String value)
  6. asInteger(String param)