Hi,
message.Text() is a QString.
I want to remove some text.
The text can be:
- Normal: "
This is a text
" - With a label: "
<label1>something</label1>This is a text
"
First, I find if the text has the label:
!message.Text().contains("<label1>", Qt::CaseInsensitive))
So, if it has, I want to remove the first part, to have a normal text "This is a text".
I tried this:
first=message.Text().indexOf("<label1>");
last=message.Text().lastIndexOf("</label1>");
message.Text().remove(first,last);
But I got Compiler Error C2663.
I also know that the message.Text().remove(QChar('<label1'), Qt::CaseInsensitive);
is another way to do it. But in my case, the part between the label is unkwnow.
It can be <label1>something</label1>
or <label1>oisdioadj</label>
or <label1>7</label1>
....
Any idea?
Regards.