[solved]Merge two QStringList elements
General and Desktop
3
Posts
2
Posters
2.9k
Views
2
Watching
-
wrote on 29 Aug 2015, 13:07 last edited by AntonZelenin
Is there any opportunity to merge two elements of a QStringList?
For example I have list "I", "have", "an", "apple" and i want to make such list: "I have", "an", "apple" -
There's no convenience function for that but it's pretty simple nonetheless:
QString temp = stringList.takeAt(i); temp += stringList.takeAt(i) stringList.insert(i, temp);
or even
stringList[i] += stringList.takeAt(i+1);
-
There's no convenience function for that but it's pretty simple nonetheless:
QString temp = stringList.takeAt(i); temp += stringList.takeAt(i) stringList.insert(i, temp);
or even
stringList[i] += stringList.takeAt(i+1);
wrote on 29 Aug 2015, 14:59 last edited by@Chris-Kawa
Thanks=)
1/3