How would I split a sentence into half, until none of the resulting parts are longer than, say 8 words?
Here is a sample text of 39 words:
“This is a long string that can be different since this is a black box
function and I do not know what strings I am going to receive, but I
need to be shorter for sure by a lot.”
Resulting output
This is a long string that can be
different since this is a black box
function and I do not know what strings
I am going to receive, but I
need to be shorter for sure by a
lot
Any tips please?
Try this