Here you can find the source of toLong(String src)
public static long toLong(String src)
//package com.java2s; public class Main { public static long toLong(String src) { long dest = 0; if (src == null || src.trim().equals("")) { return 0; }/*from w w w . java 2 s. com*/ try { dest = Long.parseLong(src.trim()); } catch (Exception e) { } return dest; } public static boolean equals(String one, String another) { if (one == null) { if (another == null) { return true; } else { return false; } } else { if (another == null) { return false; } else { return one.equals(another); } } } public final static String trim(String target) { if (target == null) return null; target = target.trim(); return "".equals(target) ? null : target; } public static String trim(Object src) { if (src == null) { return ""; } String str = src.toString(); return str.trim(); } }