Let’s say I have this String –
string = "AEIOU";
and I wanted to convert it to an ArrayList<String>, where each character is it’s own individual String within the ArrayList<String>
[A, E, I, O, U]
EDIT: I do NOT want to convert to ArrayList<Character> (yes, that’s very straightforward and I do pay attention in class), but I DO want to convert to an ArrayList<String>.
How would I do that?
transform the
Stringinto achararray,and while you iterate over the array, transform each
charinto aString, and then add it to the list,