Is there any way to say ignore case with "in"?

Torsten Bronger bronger at physik.rwth-aachen.de
Fri Apr 4 23:08:11 CEST 2008


Hallöchen!

tinnews at isbd.co.uk writes:

> Is there any way in python to say
>
>     if string1 in string2:
>         <do something>
>
> ignoring the case of string1 and string2? 

You can "normalise" both first, i.e. converting to lower case.

Tschö,
Torsten.

-- 
Torsten Bronger, aquisgrana, europa vetus
                                      Jabber ID: bronger at jabber.org
               (See http://ime.webhop.org for further contact info.)



More information about the Python-list mailing list