I need to get a “teaser” string from a longer string, getting the first N characters is easy, but I need to make sure the last word is a complete word. If the word is cut off I need to not include it in the substring.
I can get the first N chars using:
str.Substring(0, N);
But how do I make sure the last word is a “complete word”. The delimiter would be a space ‘ ‘.
1