I\'m looking for ignore case string comparison in Python.
I tried with:
if line.find(\'mandy\') >= 0:
but no success for ignore
import re if re.search('(?i)Mandy Pande:', line): ...
There's another post here. Try looking at this.
BTW, you're looking for the .lower() method:
.lower()
string1 = "hi" string2 = "HI" if string1.lower() == string2.lower(): print "Equals!" else: print "Different!"