Java Long Number Create toLong(String numeric)

Here you can find the source of toLong(String numeric)

Description

to Long

License

Open Source License

Declaration

public static long toLong(String numeric) 

Method Source Code

//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]+");
    }
}

Related

  1. toLong(Object value)
  2. toLong(Object value, long defaultValue)
  3. toLong(Object x)
  4. toLong(short[] arr)
  5. toLong(String input, int radix, long defaultValue)
  6. toLong(String param)
  7. toLong(String parameter)
  8. toLong(String s)
  9. toLong(String s)