>> By any chance is there some function that can strip whitespace from a string?
There are functions like remove and erase. You can also use find_first_not_of with " \t\n" as the parameter if you feel confident that those characters will be sorted before the other characters, then use substr or erase to chop of that part.
What about punctuation? Are you guaranteed that there will be no punctuation in the text?