parse string for int java code example
Example 1: string to int java
String number = "10";
int result = Integer.parseInt(number);
System.out.println(result);
Copy
Example 2: convert a string to int in java
String myString = "1234";
int foo = Integer.parseInt(myString);