Search This Blog

Python: string equals ignore case


def equals_ignore_case(s1, s2):
if s1 is None and s2 is None:
return True
if s1 is None and s2 is not None:
return False
if s1 is not None and s2 is None:
return False
return s1.lower() == s2.lower()

No comments:

Post a Comment