I want to remove all the trailing whitespace characters in a QString. I am looking to do what the Python function str.rstrip() with a QString
QString
str.rstrip()
If you don't want to make a deep copy of the string:
QString & rtrim( QString & str ) { while( str.size() > 0 && str.at( str.size() - 1 ).isSpace() ) str.chop( 1 ); return str; }