Search in a list of fruit names first for the word Pear and then for Orange : QStringList « Qt « C++






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

1.Adding QStringList to QListWidget
2.A simple model that uses a QStringList as its data source
3.Complete demo for QStringList
4.Split QStringList
5.QStringList demo
6.Quick sort QStringList
7.STL-Style Iterators
8.using QStringList, append to and output and join