Here you can find the source of toInt(String param)
Convert String to Integer
Parameter | Description |
---|---|
param | a parameter |
public static int toInt(String param)
//package com.java2s; //License from project: LGPL public class Main { /**/*w w w .j ava 2 s . c o m*/ * * <p> * Convert String to Integer * </p> * * @param param * @return */ public static int toInt(String param) { try { return Integer.valueOf(param.trim()); } catch (Exception e) { return 0; } } }