Java examples for java.lang:long Parse
get Long from String
//package com.java2s; public class Main { public static void main(String[] argv) { String content = "java2s.com"; System.out.println(getLong(content)); }//from w w w. ja va 2 s .co m public static long getLong(String content) { long lngContent; try { lngContent = Long.parseLong(content); } catch (Exception e) { lngContent = 0L; } return lngContent; } }