string to int in array code example
Example 1: convert string to int array
char c = '2';
int asInt = c - '0';
//asInt = 2
Example 2: string to int array
String s = "1234";
int[] intArray = new int[s.length()];
for (int i = 0; i < s.length(); i++) {
intArray[i] = Character.digit(s.charAt(i), 10);
}