Answers for "Remover Acentos"

0

Remover Acentos

public static string removerAcentos(string texto)
{
    string comAcentos = "ÄÅÁÂÀÃäáâàãÉÊËÈéêëèÍÎÏÌíîïìÖÓÔÒÕöóôòõÜÚÛüúûùÇç";
    string semAcentos = "AAAAAAaaaaaEEEEeeeeIIIIiiiiOOOOOoooooUUUuuuuCc";

    for (int i = 0; i < comAcentos.Length; i++)
    {
        texto = texto.Replace(comAcentos[i].ToString(), semAcentos[i].ToString());
    }
    return texto;
}
Posted by: Guest on October-21-2021

Browse Popular Code Answers by Language