Is there any way to say ignore case with "in"?
7stud
bbxx789_05ss at yahoo.com
Fri Apr 4 20:16:30 EDT 2008
On Apr 4, 2:43 pm, tinn... at isbd.co.uk wrote:
> Is there any way in python to say
>
> if string1 in string2:
> <do something>
>
> ignoring the case of string1 and string2?
>
> I know I could use:-
>
> if lower(string1) in lower(string2):
> <do something>
>
> but it somehow feels there ought to be an easier (tidier?) way.
>
Easier? You mean like some kind of mind meld?
More information about the Python-list
mailing list