I'm presently utilizing the accompanying code to right-trim all the
std::strings
in my projects:
std::string s;
s.erase(s.find_last_not_of(" \n\r\t")+1);
It turns out great, yet I keep thinking about whether there are some end-cases where it might fail?