comparing strings

Roberto Alsina ralsina at unl.edu.ar
Tue Feb 15 13:37:41 GMT 2000


On Tue, 15 Feb 2000, Stephen Webb wrote:

> 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.

Look that I used lower() not upper() ;-)

Whether QString's lower() notices that "SS" is one
lower_case_char_I_can't_type I don't know. Maybe you could, well, check.

 ("\''/").__..-''"`-. .         Roberto Alsina
 `9_ 9  )   `-. (    ).`-._.`)  ralsina at unl.edu.ar
 (_Y_.)' ._   ) `._`.  " -.-'   Centro de Telematica
  _..`-'_..-_/ /-'_.'           Universidad Nacional del Litoral
(l)-'' ((i).' ((!.'             Santa Fe - Argentina
                                KDE Developer (MFCH)
The stone age didn't end for a lack of stone" Firoz Rasul





More information about the KDevelop mailing list