Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
[SOLVED] QStringList split RegExp
gian71 last edited by gian71
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?
Can you show an example of text you have and what you would like to have in your QStringList ?
gian71 last edited by 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("\"").
Do you also need the numbers or only the texts ?