comparing strings

Stephen Webb stephen.webb at cybersafe.com
Tue Feb 15 19:27:12 GMT 2000


On Mon, 14 Feb 2000, you wrote:
> On Sun, 13 Feb 2000, Martin Wiebusch wrote:
> 
> > Hi,
> > just a simple question: Is there a method in the string class to compare
> > strings without regard to upper/lower case?
> 
> QString s1="one string";
> QString s2="One String";
> 
> if (s1.lower()==s2.lower())
> 	printf ("The strings are equal regardless of case");

Does this take into account localization rules?  For example, both lower-case
sigmas in Greek map into a single upper-case sigma.  In German, at least under
some rules, the lower case esszed maps into two upper case esses.  Either of
these examples might break the above.

SMW




More information about the KDevelop mailing list