Here you can find the source of tryParseInt(String value)
Parameter | Description |
---|---|
value | a parameter |
public static Integer tryParseInt(String value)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w ww .j av a2s .c o m * Try to parse the string as integer or return null if failed * * @param value * @return */ public static Integer tryParseInt(String value) { try { return Integer.parseInt(value); } catch (NumberFormatException e) { return null; } } }