Android String to Int Convert toInt(String str, int defValue)

Here you can find the source of toInt(String str, int defValue)

Description

to Int

Declaration

public static int toInt(String str, int defValue) 

Method Source Code

//package com.java2s;

public class Main {

    public static int toInt(String str, int defValue) {
        try {// w w w. j a  va2  s .  c o m
            return Integer.parseInt(str);
        } catch (Exception e) {
        }
        return defValue;
    }
}

Related

  1. isNumberString(String input)
  2. isNumberic(String str)
  3. toInt(Object obj)
  4. toInt(String obj)
  5. toInt(String str, int defValue)
  6. toInteger(String value)
  7. toNumber(String str)
  8. amount2String(String amount)
  9. String2Int(String str)