I need to split sentence to words and punctuation marks, and place em into list, saving their sequence.
For example: "Some text here!"
. And result should be: List(Some, ,text, , here,!)
I'm using String.split("regex");
With "split" I can split text only by word or only by punctuation.
So what should I use, to split text by words and punctuation at same time? Thank you in advance.