Here you can find the source of toInteger(String numeric)
public static int toInteger(String numeric)
//package com.java2s; //License from project: Open Source License public class Main { public static int toInteger(String numeric) { return (isNumeric(numeric)) ? Integer.parseInt(numeric) : 0; }/*from w ww.ja v a 2 s .c om*/ public static boolean isNumeric(String string) { return string.matches("[+-]?[0-9]+"); } }