Showing posts with label parseInt. Show all posts
Showing posts with label parseInt. Show all posts

Sunday, April 29, 2012

Convert String to int

You may convert a String to an int, provided the String contains number only.

The following example will work in cases where an int number is contained in the string called thisString:

String thisString = "100";
int x;
x = Integer.parseInt(thisString);