compare 2 QString, use == != ? or QString::compare ?
General and Desktop
4
Posts
4
Posters
20.8k
Views
2
Watching
-
I Think == is same QString::Compare because == call operator==() and compare also.
-
compare 2 QString, use == != ? or QString::compare ?
which way is better and faster?
thank you@opengpu2
Compare gives you the option to ignore case. Also, operator== only gives you true or false, while compare can be used to sort strings.If all you want to do is check that two strings are absolutely equal, I would go for ==