Os dejo una función de Ezerpa donde podemos eliminar las tildes de nuestras variables o textos en c#, gran aporte y muchas gracias

 

public stringQuitAccents(string inputString)
{
     Regexa =newRegex(«[á|à|ä|â]»,RegexOptions.Compiled);
     Regexe =newRegex(«[é|è|ë|ê]»,RegexOptions.Compiled);
     Regexi =newRegex(«[í|ì|ï|î]»,RegexOptions.Compiled);
     Regexo =newRegex(«[ó|ò|ö|ô]»,RegexOptions.Compiled);
     Regexu =newRegex(«[ú|ù|ü|û]»,RegexOptions.Compiled);
     Regexn =newRegex(«[ñ|Ñ]»,RegexOptions.Compiled);
     inputString = a.Replace(inputString,«a»);
     inputString = e.Replace(inputString,«e»);
     inputString = i.Replace(inputString,«i»);
     inputString = o.Replace(inputString,«o»);
     inputString = u.Replace(inputString,«u»);
     inputString = n.Replace(inputString,«n»);
     returninputString;
}

Por admin

Deja una respuesta

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
100% Free SEO Tools - Tool Kits PRO