How do I convert a String to an int in Java?
Asked 07 September, 2021
Viewed 2.6K times
  • 52
Votes

How can I convert a String to an int in Java?

My String contains only numbers, and I want to return the number it represents.

For example, given the string "1234" the result should be the number 1234.

30 Answer