+ 1

What the difference between .lower() and .casefold()?

20th Aug 2020, 3:25 PM
Sean
Sean - avatar
2 Answers
+ 6
Casefolding is a more aggressive version of lower() that is set up to make many of the more unique Unicode characters more comparable. It is another form of normalizing text that may initially appear to be very different, but it takes characters of many different languages into account. Casefolding is similar to lowercasing but more aggressive because it is intended to remove all case distinctions in a string. For example, the German lowercase letter 'ß' is equivalent to 'ss'. Since it is already lowercase, lower() would do nothing to 'ß', but casefold() converts it to 'ss'.
20th Aug 2020, 3:29 PM
Steven M
Steven M - avatar
0
casefold is is used ingore case sensitive of charecter.. where lower() convert to lower case letters.. "aBc".lower() == "Abc".casefold() #true
20th Aug 2020, 4:05 PM
Jayakrishna 🇼🇳