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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…