How to convert String to Long?

3.47K viewsJava

how to convert string to long  java?

Manohar Changed status to publish July 16, 2021
Add a Comment

Use the below snippet :

public static Long convertStringToLong(String stringValue) {
NumberFormat numberFormat = NumberFormat.getInstance();
Number number = numberFormat.parse(stringValue);
return number.longValue();
}catch(Exception e){
return null;


Manohar Changed status to publish June 24, 2021
Add a Comment
You are viewing 1 out of 1 answers, click here to view all answers.
Write your answer.