Here you can find the source of toLong(String value)
public static Long toLong(String value)
//package com.java2s; //License from project: Apache License public class Main { public static Long toLong(String value) { if (value != null && value.length() > 0) { try { return Long.valueOf(value); } catch (NumberFormatException e) { return 0L; }//from ww w. ja v a2 s . c o m } return 0L; } }