Home C C++ Java Python Perl PHP SQL JavaScript Linux Selenium QT Online Test

Home » QT-C++ » Example of QStringList

QStringList Example in QT-C++

Main.cpp


#include <QList>
#include<QTextStream>

int main()
{
    QTextStream cout(stdout);
    QString string = "C++, Java, Python, PHP, CppBuzz";
    QStringList items = string.split(",");
    QStringListIterator it(items);

    while (it.hasNext()) {
        cout << it.next().trimmed() << endl;
    }

    cout<<endl;

    return 0;
}

Project view in QT Creator

Project file

Output of the program