Here you can find the source of toLong(String string)
public static Long toLong(String string)
//package com.java2s; public class Main { public static Long toLong(String string) { return string == null ? null : Long.parseLong(string.trim()); }//from w ww .j a v a 2s . com public static String trim(String string, int maxLength) { if (string == null) { return null; } if (string.length() > maxLength) { return string.substring(0, maxLength); } return string; } }