Java Long Number Parse longFromStringWithoutThrow(String longVal)

Here you can find the source of longFromStringWithoutThrow(String longVal)

Description

long From String Without Throw

License

Open Source License

Declaration

public static long longFromStringWithoutThrow(String longVal) 

Method Source Code

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

public class Main {
    public static long longFromStringWithoutThrow(String longVal) {
        long toReturn = Long.MIN_VALUE;
        try {//  ww w  .  ja va2s.co  m
            toReturn = Long.parseLong(longVal);
        } catch (NumberFormatException ignore) {
        }
        return toReturn;
    }
}

Related

  1. convertLong(String str, long defaults)
  2. convertLong(String valueAsString)
  3. longFromString(String which, String s)
  4. tryParseLong(Object obj, Long defaultVal)
  5. tryParseLong(String longString, int defaultValue)
  6. tryParseLong(String longValue)
  7. TryParseLong(String str, long[] n)