📅  最后修改于: 2022-03-11 14:45:59.421000             🧑  作者: Mango
# credit to the Stack Overflow users in the source lin
# with regex
import re
if re.search('mandy', 'Mandy Pande', re.IGNORECASE):
# do your stuff here
# Note:
# results = re.search('mandy', 'Mandy Pande', re.IGNORECASE)
# results.group(0) is the string that matched ('Mandy')
# without regex
string1 = "hi"
string2 = "HI"
if string1.lower() == string2.lower():
print("Equals!")
else:
print("Different!")