[Qt-interest] Comparing two StringLists
Anthony Serdyukov
uksus70 at gmail.com
Fri Jan 9 03:38:21 CET 2009
You can use the following feature:
QStringList A, B;
...
QSet<QString> AnotB = A.toSet() - B.toSet();
QSet<QString> BnotA = B.toSet() - A.toSet();
I'm not sure it is the fastest way from the performance point of view,
but it's the elegantest and shortest way.
2009/1/7 Khizer Kapadia <khizerkapadia at hotmail.com>:
> Hi,
> I need to compare two stringlists. I need to find out items in list A which
> are not in list B and vice versa. Currently I am using loops to perform this
> task, going through each list. Is there any function provided by Qt to
> perform this faster?
>
> Thank you
> Khizer
>
>
>
> ________________________________
> Windows LiveTM Hotmail(R): Chat. Store. Share. Do more with mail. See how it
> works.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
--
Regards,
Anthony
More information about the Qt-interest-old
mailing list