Java String Value Of valueOf(String str)

Here you can find the source of valueOf(String str)

Description

Parse String to Long.

License

Open Source License

Parameter

Parameter Description
str String.

Return

Long

Declaration

public static Long valueOf(String str) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*  w ww .j a v  a 2  s  .  c om*/
     * Parse String to Long. If error, return null.
     * @param str String.
     * @return Long
     */
    public static Long valueOf(String str) {

        try {
            return Long.valueOf(str.trim());
        } catch (Exception ex) {
            return null;
        }
    }
}

Related

  1. valueOf(String s)
  2. valueOf(String s)
  3. valueOf(String s, Class e)
  4. valueOf(String s, int def)
  5. valueOf(String str)
  6. valueOf(String stringVal, boolean dVal)
  7. valueOf(String value)
  8. valueOf(String value)
  9. valueOf(String value, boolean defaultValue)