I'm using Android Studio and I have this String in one of my activities:
[0, 25, 24, 25, 15, 16, 17, 25, 24, 21, 24]
and I want to convert it to a int[] :
{0, 25, 24, 25, 15, 16, 17, 25, 24, 21, 24};
How do I do that? I tried the code below, but it's not returning the correct value.
int[] intArray = new int[string.length()];
for (int i = 0; i < string.length(); i++) {
intArray[i] = Character.digit(string.charAt(i), 10);
}