Here you can find the source of valueOf(String str)
Parameter | Description |
---|---|
str | String. |
public static Long valueOf(String str)
//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; } } }