If I have the following string:
String string = "My \n name \n is \n John \n Doe";
And I want to separate each word and add it to an arraylist:
ArrayList<String> sentence = new ArrayList<String>();
How would I do that?
Bare in mind that the line break may not be \n - it could be anything.
Thanks