Here you can find the source of toInt(String string)
Parameter | Description |
---|---|
string | a parameter |
public static int toInt(String string)
//package com.java2s; //License from project: Open Source License public class Main { /**// w w w . j a v a 2 s . c o m * string2Int * * @param string * @return int */ public static int toInt(String string) { String str = trim(string); if ("".equals(str)) str = "0"; return Integer.parseInt(str); } /** * trim * * @param string * @return */ public static String trim(String string) { if (string == null) return ""; else return string.trim(); } }