How do I remove trailing whitespace from a QString?

前端 未结 9 1785
甜味超标
甜味超标 2020-12-29 19:24

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

9条回答
  •  情歌与酒
    2020-12-29 19:39

    As far as I know, the only built-in-functions are trimmed() and simplified(). So you will need to trim manually. In that case you should use the QChar function isSpace() to check if a character is a space character.

提交回复
热议问题