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.

Example

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

Syntax

txt.casefold()

Parameter Value

No parameters

Return Value

ValueExplanation
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.

Example

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

Share this Page

Meet the Author