Search in a list of fruit names first for the word Pear and then for Orange
#include <QStringList>
#include <QDebug>
int main()
{
QStringList list;
list << "apple" << "pear" << "banana";
QStringList::iterator i1 = qFind(list.begin(), list.end(), "pear");
QStringList::iterator i2 = qFind(list.begin(), list.end(), "orange");
return 0;
}
Related examples in the same category