Here you can find the source of toLong(String numeric)
public static long toLong(String numeric)
//package com.java2s; //License from project: Open Source License public class Main { public static long toLong(String numeric) { return (isNumeric(numeric)) ? Long.parseLong(numeric) : 0; }/*from w w w . ja va 2 s.c o m*/ public static boolean isNumeric(String string) { return string.matches("[+-]?[0-9]+"); } }