Java Long Number Create toLong(String input, int radix, long defaultValue)

Here you can find the source of toLong(String input, int radix, long defaultValue)

Description

to Long

License

Apache License

Declaration

public static long toLong(String input, int radix, long defaultValue) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    public static long toLong(String input, int radix, long defaultValue) {
        try {/*  ww  w.  j  a va  2 s .  co  m*/
            return Long.parseLong(input, radix);
        } catch (Exception e) {
            return defaultValue;
        }
    }

    public static long toLong(String input, long defaultValue) {
        try {
            return Long.parseLong(input);
        } catch (Exception e) {
            return defaultValue;
        }
    }
}

Related

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