I'm trying to shorten a string so that it is at most 50 characters long. However, only complete words should be included.
Example:
a <- "This is a very long string that should be a maximum of 50 characters and just full words"
expected result:
"This is a very long string that should be a"
Many Thanks.