I have a large array that I need to send in small sections (between 200 characters and 400 characters)
The problem that arises for me is that I don't want to cut the words but only in the spaces
How can I create from the string a division into small sections?
To give an example I used a text generator
Unbowed, Unbent, Unbroken. It's ten thousand miles between Kings landing and the wall. The tourney of Ashford Meadows. Pay the iron price. The winds of Winter. King in the North. The War of the 5 kings. It's ten thousand miles between Kings landing and the wall. The winds of Winter. Words are like wind. Bastards are born of passion, aren't they? We don't despise them in Dorne. The night is dark and full of terrors. And now his watch is ended. May the Father judge him justly. The rains of castamere. What is dead may never die. A Lannister always pays his debts. Never Resting. A good act does not wash out the bad, nor a bad act the good. Each should have its own reward. Unbowed, Unbent, Unbroken.
I want the result to be Unbowed, Unbent, Unbroken. It's ten thousand
and not Unbowed, Unbent, Unbroken. It's ten thou
Thank you