How to remove Singlequotes?
Solved
General and Desktop
-
Hi,
I have Qstringlist and i need to remove single quotes of item at 0 index, and then store in a Qstring. but i didn't find any method like remove.
Plz tell how to do this ?QStringList DataItem; QString qsType=""; QString Singlequote; Singlequote="\'"; qsType = DataItem.at(0).remove(Singlequote);//there is no remove function in Qstringlist.
Thankyou
-
there is no remove function in Qstringlist.
thats wrong, QStringList and QString(what you're actually trying to modify here) have remove functions
The problem you're having is, that you try to modify a const QString ref
QString::remove
modifies the QString object and returns a reference of the string.quick and dirty fix:
qsType = QString(DataItem.at(0)).remove(Singlequote);