Java Long Number Parse longFromString(String which, String s)

Here you can find the source of longFromString(String which, String s)

Description

long From String

License

Open Source License

Declaration

private static long longFromString(String which, String s) 

Method Source Code

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

public class Main {
    private static long longFromString(String which, String s) {
        try {/*from   w w w .jav a  2s. co  m*/
            return Long.parseLong(s);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException(String.format(
                    "%s must be an integer", which), e);
        }
    }
}

Related

  1. convertLong(String str, long defaults)
  2. convertLong(String valueAsString)
  3. longFromStringWithoutThrow(String longVal)
  4. tryParseLong(Object obj, Long defaultVal)
  5. tryParseLong(String longString, int defaultValue)
  6. tryParseLong(String longValue)