Python - String casefold() Method
The Python String casefold() method is used to convert all characters of the string in lowercase. Any symbol, space, or number in the string is ignored while applying this method. Only alphabet are converted.
It is similar to string lower() method but stronger version, which converts more characters into lowercase. Due to this feature, it finds more matches when comparing two strings after converted using casefold() method
No parameter is required.
Returns the string with all characters of the specified string is in lower case.
In the below example, casefold() method is used to convert all characters of the given string in lowercase.
MyString = "Hello John!" print(MyString.casefold())
The output of the above code will be:
❮ Python String Methods