Chapters
Python114 chapters

ReferenceString methods

str.casefold()

A more thorough lower(), for comparing text across languages.

Signature

text.casefold()

Returns

A new string.

Example

Python
print("Stra\u00dfe".casefold() == "strasse".casefold())
print("Stra\u00dfe".lower() == "strasse".lower())

Output

True
False

See also