{"id":24445,"date":"2021-10-17T18:40:07","date_gmt":"2021-10-17T13:10:07","guid":{"rendered":"https:\/\/python-programs.com\/?p=24445"},"modified":"2021-11-05T19:23:50","modified_gmt":"2021-11-05T13:53:50","slug":"program-for-python-string-casefold-method","status":"publish","type":"post","link":"https:\/\/python-programs.com\/program-for-python-string-casefold-method\/","title":{"rendered":"Program for Python String casefold() Method"},"content":{"rendered":"

In the previous article, we have discussed Python Program for capitalize() Function<\/a>
\ncasefold() Function in Python:<\/strong><\/p>\n

The casefold() method produces a string in which all of the characters are lower case.<\/p>\n

This method is similar to lower(), but the casefold() method is stronger and more aggressive, which means it will convert more characters into lower case and find more matches when comparing two strings that have both been converted using the casefold() method.<\/p>\n

Syntax:<\/strong><\/p>\n

string.casefold()<\/pre>\n

Parameters:<\/strong> This function doesn’t have any parameters.<\/p>\n

Examples:<\/strong><\/p>\n

Example1:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"hello this is BTECHGEEKS\"\r\nGiven second string = \"10345 GOOD MORNING btechgeeks\"<\/pre>\n

Output:<\/strong><\/p>\n

The above given first string is : hello this is BTECHGEEKS\r\nThe given first string after applying casefold() function: hello this is btechgeeks\r\nThe above given second string is : 10345 GOOD MORNING btechgeeks\r\nThe given second string after applying casefold() function: 10345 good morning btechgeeks<\/pre>\n

Example2:<\/strong><\/p>\n

Input:<\/strong><\/p>\n

Given first string = \"HeLLO ThiS is BTECHgeeks 12345\"\r\nGiven second string = \"GOOD MORNING THIS IS BTECHGEEKS\"<\/pre>\n

Output:<\/strong><\/p>\n

The above given first string is : HeLLO ThiS is BTECHgeeks 12345\r\nThe given first string after applying casefold() function: hello this is btechgeeks 12345\r\nThe above given second string is : GOOD MORNING THIS IS BTECHGEEKS\r\nThe given second string after applying casefold() function: good morning this is btechgeeks<\/pre>\n

Program for casefold() Function in Python<\/h2>\n