I\'m trying to convert a String variable into an integer, only the String looks like this (for example):
String string = \" 12\";
And so the St
The string split() method works well if you have a string of multiple numbers separated by spaces.
String numbers = "1 23 456";
String[] numbersArray = numbers.split(" "); // splitting string by spaces
System.out.println(numbersArray.toString());
// output ["1","23","456"]
Then you can use Integer.parseInt() on each index of the array. Hope that helps