how can I split a string and take the separator into the array? For example I have a string with two sentences:
"I am learning Javascript. The most exiting programming language."
I would like to have following result after splitting with split(".")
:
array[0] consists of "I am learning Javascript.
array[1] consists of "The most exiting programming language."
I don't want to lose the punctuation at the end of a sentence. How can I achieve that?
Update: This is not the same issue like here: Javascript and regex: split string and keep the separator
because the br-tag is not displayed, since it is html code. The punctuation in my case should be seen explicitly.