Parsing strings with QT

  • Is there any simple and elegant way to parse strings like this:


    in QT? The line consists from command, then comma and after then field names with equations separated by commas.

  • Lifetime Qt Champion


    Depends on what you want to get from your parsing. e.g.

    @QStringList elementList = myString.split(',');@

    and you have a list containing each element.

    You can also use regular expressions with QRegularExpression or QRegExp if you're on Qt 4

    Hope it helps

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.