Python String casefold() Method

You are Here:

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)

Output

wikimass.com is for programmers

Syntax

txt.casefold()

Parameter Value

No parameters

Return Value

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

Output

True

Reminder

Hi Developers, we almost covered 90% of String functions and Interview Question on Python with examples for quick and easy learning.

We are working to cover every Single Concept in Python.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author