Translate

Tuesday 19 May 2020

Python tip 1: casefold() function

Python Case fold function is very useful when we have special alphabets from other languages. We can use casefold() function for caseless matching.

It is similar to the lower function available in Python. So now the question arises why should i use this?



Let us imagine we have a special character from a different language. For example let's imagine we have a letter in German and let us what difference does it make by using the case hold function.

If you notice the lower function only was able to modify the words in english from Upper to lowe case however casefold() uses strict policy to convert the uppercase to the corresponding lowercase value even though it is from a different language.
Hope this post was useful. 



No comments:

Post a Comment