Java String Parse tryParse(String pValue)

Here you can find the source of tryParse(String pValue)

Description

Seriously..

License

Open Source License

Parameter

Parameter Description
pValue a parameter

Declaration

public static boolean tryParse(String pValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*w w w .  ja va2  s  .  c om*/
     * Seriously.. no tryparse and no byreference calls, what is this, dos-batch?
     * @param pValue
     * @return
     */
    public static boolean tryParse(String pValue) {
        try {
            Integer.parseInt(pValue);
            return true;
        } catch (NumberFormatException nfe) {
            return false;
        }
    }
}

Related

  1. tryParse(String input, Object defVal)
  2. tryParse(String s, double d)
  3. tryParse(String s, int i)
  4. tryParse(String s, Integer defaultValue)
  5. tryParse(String val, int defaultValue)