Here you can find the source of toInt(String str)
public static int toInt(String str)
//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; } }