Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to convert string " 123" to integer 123

807589Jun 30 2008 — edited Jun 30 2008
Hello guys!


I have a question here, if a string is " 123", how can I convert it to integer 123?

The point is in the string " 123", before 123 there are some spaces, I can not directly use this command [Integer.parseInt].

Please help me, thanks.


Lee
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 28 2008
Added on Jun 30 2008
8 comments
573 views