Skip to content

Instantly share code, notes, and snippets.

@skvggor
Forked from marioluan/remover-acentos.js
Last active August 29, 2015 14:02
Show Gist options
  • Save skvggor/874ae31431f73ca3b232 to your computer and use it in GitHub Desktop.
Save skvggor/874ae31431f73ca3b232 to your computer and use it in GitHub Desktop.
removerAcentos = (texto) ->
mapa =
a : /[\xE0-\xE6]/g
e : /[\xE8-\xEB]/g
i : /[\xEC-\xEF]/g
o : /[\xF2-\xF6]/g
u : /[\xF9-\xFC]/g
c : /\xE7/g
n : /\xF1/g
for letra of mapa
texto = texto.replace mapa[letra], letra
texto
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment