Monday, May 11, 2026
HomeLanguagesPython String casefold() Method

Python String casefold() Method

Python String casefold() method is used to convert string to lowercase. It is similar to the Python lower() string method, but the case removes all the case distinctions present in a string.

Python String casefold() Method Syntax

Syntax:  string.casefold()

Parameters: The casefold() method doesn’t take any parameters.

Return value: Returns the case folded string the string converted to lower case.

Python String casefold() Method Example

Python3




string = "GEEKSFORGEEKS"
 
print("lowercase string: ", string.casefold())


Output:

lowercase string: neveropen

Difference between casefold() and lower() in Python

Python String casefold() Method is more aggressive in conversion to lowercase characters because it tends to remove all case distinctions in a String.

Python3




string = "ß"
 
print("Using lower():", string.lower())
print("Using casefold():", string.casefold())


Output:

Using lower(): ß
Using casefold(): ss

Practical Example using Python String casefold() Method

Here, we have a Python String with characters of mixed cases. We are using the Python casefold() Method to convert everything to lowercase.

Python3




string = "WeightAGE oF THe DiScuSSiON"
 
print("Original String:", string)
# print the string after casefold transformation
print("String after using casefold():", string.casefold())


Output:

Original String: WeightAGE oF THe DiScuSSiON
String after using casefold(): weightage of the discussion
RELATED ARTICLES

1 COMMENT

Most Popular

Dominic
32514 POSTS0 COMMENTS
Milvus
131 POSTS0 COMMENTS
Nango Kala
6892 POSTS0 COMMENTS
Nicole Veronica
12012 POSTS0 COMMENTS
Nokonwaba Nkukhwana
12107 POSTS0 COMMENTS
Shaida Kate Naidoo
7016 POSTS0 COMMENTS
Ted Musemwa
7262 POSTS0 COMMENTS
Thapelo Manthata
6975 POSTS0 COMMENTS
Umr Jansen
6963 POSTS0 COMMENTS