I have an array:
int test[]={10212,10202,11000,11000,11010};
I want to split the inetger values to individual digits and place them in a new array as individual elements such that my array now is:
int test2[]={1,0,2,1,2,1,0,2,0,2,1,1,0,0,0,1,1,0,0,0,1,1,0,1,0};
How would i go about doing that? I’m doing this in java.
Thank you.
This will do exactly what you want by placing the lowest order digit of an entry into the “front” of an arraylist, and therefore in front of the previous low order digits/entries.
If you need it to be in an Array, ArrayList has a toArray method.