[SOLVED] QStringList split RegExp



  • I have a simple problem but I am having very difficult time to find a solution.
    I am reading from a File line by line and then using QStringLIst.split(" ") to get all the contents of a specific line.
    There are lines where there is something like: 1 "a aaa aaaa" 2 "bbbbb bbb" 3 "cccc"... so there are strings inside the line.
    In this case using " " as RegExp to split a line does not do the Job for me...because I need to get the whole strings inside a line.

    Is there anybody that can give me some suggestions on this topic?

    Thanks

    G.


  • Lifetime Qt Champion

    Hi,

    Can you show an example of text you have and what you would like to have in your QStringList ?



  • @SGaist
    Ok I have just find a solution, I just needed to use split(""");

    Let's say you have this line as QStringList:
    1 "Active" 0 "Not Active"

    Using split(" ") I was not able to keep "Not Active" as single String, I needed split("\"").

    Thanks

    G.


  • Lifetime Qt Champion

    Do you also need the numbers or only the texts ?


Log in to reply
 

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