Here you can find the source of toInt(String s)
public static int toInt(String s)
//package com.java2s; public class Main { public static int toInt(String s) { try {//www .j a va 2s . co m return Integer.parseInt(s); } catch (NumberFormatException e) { return 0; } } }