-2

I am trying to parse string to long as follows:

Long _id_long= Long.valueOf(_id);

The error message:

java.lang.NumberFormatException: For input string: "DT31988159" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Long.parseLong(Unknown Source)

Klausos Klausos
  • 15,308
  • 51
  • 135
  • 217

1 Answers1

0

Have you read the JavaDoc of Long.valueOf(String)? You will find NumberFormatException.

Thrown to indicate that the application has attempted to convert a string to one of the numeric types, but that the string does not have the appropriate format.

Just remove the prefix.

Community
  • 1
  • 1
spongebob
  • 8,370
  • 15
  • 50
  • 83