python string remove accent

Solutions on MaxInterview for python string remove accent by the best coders in the world

showing results for - "python string remove accent"
Carl
18 Oct 2020
1def convert_to_non_accent(string):
2    """ Function to convert accent characters to non accent
3    characters.
4    :param string: String to be converted.
5    :type string: str
6    :return: str
7    """
8    return ''.join(ch for ch in unicodedata.normalize('NFKD', string)
9                   if not unicodedata.combining(ch))