How to split a string with java but also keep the delimiters end of sentance -


possible duplicate:
is there way split strings string.split() , include delimiters?

suppose have following sentences-

what name? name don. nice! 

i want output java follows

what name? name don. nice! 

i used java split() method. split without delimiters. used split("[\\.!?]")

this trick:

split("(?<=[.?!])"); 

(adapted this great answer)


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -