Here you can find the source of toLong(String s)
Parameter | Description |
---|---|
s | is the string to parse as an Long |
public static Long toLong(String s)
//package com.java2s; public class Main { /**//w ww . j av a2s. com * Translate a string s to an Long. * * @param s is the string to parse as an Long * @return the long translation of string s, or return null if s is not a * long. */ public static Long toLong(String s) { Long l = null; try { l = Long.parseLong(s); } catch (NumberFormatException e) { // leave i = null } return l; } }