hello~
I have a string like following,
"%aaa\nbbb"
and I want to replace "%aaa" to "x".
Here is my code.
QString text = "%aaa\nbbb";
QRegExp rx = "\\b%aaa";
text.replace( rx, "x" );
qDebug( "%s", qPrintable( text ) );
Output:
%aaa\nbbb
Unfortunately, "%aaa" never changed.
If I remove "%" character then that is done as I wants it done.
I don't know how can I replace strings start with "%" or "$".
Bookmarks