Home >>Python String Methods >Python String casefold() Method

Python String casefold() Method

Python String casefold() Method

Python string casefold() method is used to return a string where all the characters are lower case. It is similar to the lower() method it converts more characters into lower case and find more matches when comparing two strings and both are converted using this method.

Syntax:
string.casefold()
Here is an example of Python casefold() method:

txt = "Welcome to PHPTPOINT"
x = txt.casefold()
print(x)

Output:
welcome to phptpoint
Example 2:

txt = "We have got 5 new Projects!!"
x = txt.casefold()
print(x)

Output:
we have got 5 new projects!!