Java Long Number Create toLong(String value)

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

Description

to Long

License

Open Source License

Declaration

public static long toLong(String value) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static long toLong(String value) {
        return toLong(value, 0);
    }//from  ww  w. ja v  a2  s  .com

    public static long toLong(String value, long defaultValue) {

        long valueAsLong = 0;

        try {
            valueAsLong = Long.parseLong(value);
        } catch (NumberFormatException e) {
        }

        return valueAsLong;
    }
}

Related

  1. toLong(String strVal)
  2. toLong(String time)
  3. toLong(String tStr)
  4. toLong(String v, long def)
  5. toLong(String val)
  6. toLong(String value)
  7. toLong(String value)
  8. toLong(String value)
  9. toLong(String value)