Here you can find the source of convertStringToInteger(String strParaConvert)
Parameter | Description |
---|---|
strParaConvert | a parameter |
public static Integer convertStringToInteger(String strParaConvert)
//package com.java2s; //License from project: Open Source License public class Main { /**/* w w w .j a v a2 s.com*/ * Converte uma String em Integer. * @param strParaConvert * @return */ public static Integer convertStringToInteger(String strParaConvert) { if (strParaConvert == null) return new Integer(0); if (strParaConvert.trim().equalsIgnoreCase("")) return new Integer(0); try { int aux = Integer.parseInt(strParaConvert); return new Integer(aux); } catch (Exception e) { return new Integer(0); } } }