Firstly, I know that there may be a duplicate but I do not understand them, so please don't mark this as a duplicate!
I wish to split the strings in an array (see below) into characters:
Original:
String original = "0, 0, 0, 0 | 1, 1, 1, 1 | 2, 2, 2, 2"
Array:
String[] array2 = {"0, 0, 0, 0", "1, 1, 1, 1", "2, 2, 2, 2"}
Result that I want:
String[] arrayprime = {"0", "0", "0", "0", "1", "1", "1", "1", "2", "2", "2", "2"}
How would you do this? I thought of
String[] array2 = original.split("\\|");
String[] arrayprime = array2.split(", ");
but it doesn't seem to work (says "Cannot find symbol").
Should I make the array (array2) into a String (if so, how)? And then split again?