Case In-Sensitive Compare : Compare String : String PYTHON TUTORIALS


PYTHON TUTORIALS » String » Compare String »

 

Case In-Sensitive Compare


cmpStr = "abc"
upperStr = "ABC"
lowerStr = "abc"


print "nCase In-Sensitive Compare"
if cmpStr.upper() == lowerStr.upper():
    print lowerStr + " Matches " + cmpStr

if cmpStr.upper() == upperStr.upper():
    print upperStr + " Matches " + cmpStr



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo String
» Compare String