SyntaxFix
Write A Post
Hire A Developer
Questions
You want to use the Integer.parseInt(String) method.
try{ int num = Integer.parseInt(str); // is an integer! } catch (NumberFormatException e) { // not an integer! }