I'm at a loss with dividing a string into 2 substrings. The first substring's length should be no more than 35 and it should end with the end of the word. So, if the 35 limit falls mid-word, then break the string when this word starts (let's say on 32). by word I mean any combo of non-space characters. words are divided by spaces. The second substring can be of any length and, consequently, should start with the start of a word. The string is always bigger than 35 and doesn't have a pattern. How can I implement it? Thanks in advance!

Example:

> 
> "Lordem ipsum dolor sit amet, $200 cons(35 chars until here)ectetur adipiscing elit, №22sed 70 % do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."
> 
> 
> 

This is a long String. Then i need to get to strings : `"Lordem ipsum dolor sit amet, $200"` (fewer than 35 and ends where word ends) and the rest into one big separate substring