Here you can find the source of toLong(String string)
public static long toLong(String string)
//package com.java2s; //License from project: Open Source License public class Main { public static long toLong(String string) { String str = trim(string); if ("".equals(str)) str = "0"; return Long.parseLong(str); }/*ww w. j a v a 2 s.c om*/ /** * trim * * @param string * @return */ public static String trim(String string) { if (string == null) return ""; else return string.trim(); } }