Here you can find the source of convertStringToInt(String str)
public static int convertStringToInt(String str)
//package com.java2s; public class Main { public static int convertStringToInt(String str) { return convertStringToInt(str, 0); }// ww w .jav a2s .c o m public static int convertStringToInt(String str, int failValue) { if (str == null) { return failValue; } try { return Integer.parseInt(str); } catch (Exception e) { e.printStackTrace(); } return failValue; } }