Sunday, December 16, 2012

How to convert string to int in Java?

int foo = Integer.parseInt("1234");
See the Javadoc for more information.
(If you have it in a StringBuffer, you'll need to do Integer.parseInt(myBuffer.toString());instead).

No comments:

Post a Comment