string.find for case insensitive search

Duncan Booth duncan.booth at invalid.invalid
Wed Feb 7 16:34:26 EST 2007


"Don Morrison" <donmorrison at gmail.com> wrote:

> lower() is also deprecated :) oh well
> 
> On 7 Feb 2007 21:06:08 GMT, Duncan Booth
> <duncan.booth at invalid.invalid> wrote: 
>> "Johny" <python at hope.cz> wrote:
>>
>> > Is there a good way how to use string.find function to find a
>> > substring if I need to you case insensitive substring?
>>
>> s.lower().find(substring.lower())
>>
No. RTFM and don't top post.

The functions such as lower() and find() in the string *module* are 
deprecated. The methods are what you should use.




More information about the Python-list mailing list