I have a String that contains spaces, and I want to create an ArrayList that contains each character of the String as a single item in the list, whitespace omitted. For example, let's say I have a String as follows:
String text = "this is my text";
Then I want to go through that text letter by letter, adding each letter (either as a char or String, it doesn't matter) to an ArrayList as a separate item, and ignoring spaces.
So my ArrayList would contain 12 items: t, h, i, s, i, s, m, y, t, e, x, and t.
How can I do this? Any help or suggestions would be greatly appreciated. Thanks!