Here you can find the source of asLong(String str)
protected static long asLong(String str)
//package com.java2s; //License from project: Open Source License public class Main { protected static long asLong(String str) { if (str != null && str.length() > 0) try { return Long.parseLong(str.trim()); } catch (Exception e) { }// w ww . jav a2 s . c o m return 0; } }