QStriingList

#include <QCoreApplication>
#include<QDebug>
#include<QStringList>
int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    QStringList List;
    QString Line = "a, b, c, d, f, g";
    //List.append("Hello");
    List = Line.split(",");
    List.replaceInStrings("b", "goog");

    QString After = List.join(",");
    foreach(QString itm, List)
    {
        qDebug() << itm;
    }

    qDebug()<<After;

    return a.exec();
}

  

posted @ 2016-12-17 18:53  mCat  Views(303)  Comments(0Edit  收藏  举报