I'm using the Play Framework and taking a text from a textarea and I want to split it into an array of the words, spaces and newlines that was entered.
Hello World How
Are You
Would be something like
a[0] = "Hello";
a[1] = " ";
a[2] = "World";
a[3] = " ";
a[4] = "How";
a[5] = "\n";
a[6] = "Are";
a[7] = " ";
a[8] = "You";
If there is a simple regex way or something similar I would love to hear about it?