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 have or don't need any whitespace at the beginning either, you could use QString QString::trimmed () const.
This ignores any internal whitespace, which is corrected by the alternative solution provided by Andrejs Cainikovs.