开发者

QRegExp containing line feed, enter

开发者 https://www.devze.com 2023-03-02 02:39 出处:网络
I have no clue how to use QRegExp. I am trying to remove selected characters from QString but don\'t kno开发者_如何学JAVAw how to write it as regular expression, never worked with those :( I want to r

I have no clue how to use QRegExp. I am trying to remove selected characters from QString but don't kno开发者_如何学JAVAw how to write it as regular expression, never worked with those :( I want to remove all line feeds, enters, |, ¦, and §.

Thanks

Ps: I wish to use QString & QString::remove ( const QRegExp & rx ) and not QString & QString::remove ( const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive ) several times.


mystring.remove(QRegExp("[\\n\\r|\xA6\xB6\xA7]")); (untested)

0

精彩评论

暂无评论...
验证码 换一张
取 消