Searching and deleting strings
General and Desktop
4
Posts
2
Posters
966
Views
1
Watching
-
Hello, I've recently joined this group and used Qt for 3 months.
I have been coding an address book. I store data in a file and use QTreeview to display them.
My current problem is how to search a string in a file, find it and then delete it.
Please I need help.
Sorry for mistake!!! English is not my mother tongue.
Have a nice day. -
hi!
you might be looking for this:@QByteArray textData;
QFile file(myFile);
file.open(QFile::ReadWrite|QFile::Text);
textData= myFile.readAll();
QString strText(textData);@
and then use a :
QString & QString::remove(const QString & str, Qt::CaseSensitivity cs = Qt::CaseSensitive)//check out QString docs