Entry: Java. Lang. numberformatexception: for input string: "limit 11 ″

Source: Internet
Author: User

In executionCode:

 
  Long. parselong (datacolumn [0]. Trim ())

The following exception occurs:

 

 
  Java. Lang. numberformatexception: for input string:"11"

 

 

In general, as long as the conversion is not empty, there are no special characters, and no spaces, it can be converted, But here 11 cannot be converted.

In the code,Datacolumn [0But why can't I explain it?

Take a closer look and see in the GuideFor input string:"11", It seems that something was added before 11, but reading the data in the file is indeed 11.


The encoding of this 11 originally stored in my files is incorrect.

I saved it as UTF-8 encoding with notepad:


But with editplus opened, found that the UTF-8 file stored in Notepad has become UTF-8 + BOM encoding, what solution?



The problem here is that the encoding is incorrect. After modification, you can.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.