Here you can find the source of toLong(String value)
public static long toLong(String value)
//package com.java2s; //License from project: Open Source License public class Main { public static long toLong(String value) { return toLong(value, 0); }//from ww w. ja v a2 s .com public static long toLong(String value, long defaultValue) { long valueAsLong = 0; try { valueAsLong = Long.parseLong(value); } catch (NumberFormatException e) { } return valueAsLong; } }