Here you can find the source of atoi(String s)
public static int atoi(String s)
//package com.java2s; //License from project: Open Source License public class Main { public static int atoi(String s) { int value = 0; try {/*from w w w .j a v a 2 s . co m*/ value = Integer.parseInt(s); } catch (NumberFormatException ex) { value = 0; } return value; } }