Java Integer Create toInt(String str)

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

Description

to Int

License

Open Source License

Declaration

public static int toInt(String str) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static int toInt(String str) {
        return checkStr(str) ? Integer.parseInt(str) : 0;
    }//from  ww  w .j  a va2s.  co  m

    private static boolean checkStr(String str) {
        boolean bool = true;
        if (str == null || "".equals(str.trim()))
            bool = false;
        return bool;
    }
}

Related

  1. toInt(String s, int defaultInt)
  2. toInt(String s, int exception)
  3. toInt(String sInt)
  4. toInt(String str)
  5. toInt(String str)
  6. toInt(String str)
  7. toInt(String str)
  8. toInt(String str)
  9. toInt(String str)