So, I have text like this
String s = "The if-then-else statement provides a secondary path of execution when an "if" clause evaluates to false. You could use an if-then-else statement in the applyBrakes method to take some action if the brakes are applied when the bicycle is not in motion. In this case, the action is to simply print an error message stating that the bicycle has already stopped."
I need to split this string in Sentences but save punctuation mark at the end of Sentence, so I cant just use something like this:
s.split("[\\.|!|\\?|:] ");
Because if I use it I receive this:
The if-then statement is the most basic of all the control flow statements
It tells your program to execute a certain section of code only if a particular test evaluates to true
For example, the Bicycle class could allow the brakes to decrease the bicycle's speed only if the bicycle is already in motion
One possible implementation of the applyBrakes method could be as follows:
And I'm loosing my punctuation mark at the end, so how can I do it?