Let us say I have a long string
String s1="This is my world. This has to be broken."
I am breaking the above string at a fixed interval of string length let's say when it's 10.
So the output I get after breaking is
This is my
world. Thi
s has to b
e broken.
Where as I want that the string should contain complete words and not broken words.
Just like this I want the output to be
This is my
world.
This has
to be
broken.
How can I achieve the above output.