casefold() String Method in Python with Examples

casefold() method returns a version of the string suitable for caseless comparisons.

Example: casefold() String Method


message = 'Welcome to Python!'
print(message.casefold())

Output

welcome to python!


Related String Methods