Neatest way to do a case insensitive "in"?

Jervis Whitley jervisau at gmail.com
Thu Mar 19 17:52:35 EDT 2009


On Fri, Mar 20, 2009 at 8:28 AM, Albert Hopkins <marduk at letterboxes.org> wrote:
> On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote:
>> >
>> >    if stringA.lower() in stringB.lower():
>> >        bla bla bla
>> >
>>
>>     from string import lower
>>
>>     if lower(stringA) in lower(stringB):
>>          # was this what you were after?
>>
>
> This is analogous to standing behind a perfectly functioning automobile
> and pushing it everywhere you want to go.

It is an alternative solution. That is all.

Cheers,

Jervis



More information about the Python-list mailing list