Python String casefold() Method

Last Updated:

Python String casefold()

The casefold() method converts a string into lowercase.

This method is similar to the lower() method, but the casefold() method is more aggressive by removing all the case distinctions present in a string.


Python Compiler
txt = "wikimaß.com is for programmers" x = txt.casefold() print(x)



Parameter Value

No parameters

Return Value

String Returns a string where all the characters are converted into lowercase.

More Example

In the following example, the letter ß is called Eszett, literally meaning s z. However, when the letter is not available (or when a word is in all caps), ß is almost always substituted by the digraph ss rather than sz.


Python Compiler
txt1 = "wikimaß.com is for programmers" txt2 = " is for programmers" x = txt1.casefold() print(x == txt2) # True

Share this Page

Meet the Author