I have string: "This is a sample string", and I need to split it to 2 strings, without break the words, and that the two strings will have the closest length, so the result will be:
["This is a", "sample string"].
Another e.x.:
"Gorge is nice" => ["Gorge", "is nice"]
Also it will be nice, if the function can get as param the number of elements that I will get as result.
Thanks for the help!