String Methods
casefold()
Return a very thorough lowercase version for case-insensitive text matching.
str.casefold()
str.casefold() returns a case-folded copy of the string designed for aggressive, caseless string matching.
Casefolding is similar to lowercasing, but handles international and Unicode characters (like converting German 'ß' to 'ss') more thoroughly than lower().
Returns
A case-folded string.
Try it
Run it and change it
word = "Straße" print(word.casefold())
Worth knowing
- Caseless equality checks: When comparing user input where case should be ignored across all languages,
text1.casefold() == text2.casefold()is the recommended best practice.