Skip to content

Instantly share code, notes, and snippets.

@marti1125
Created December 18, 2014 16:22
Show Gist options
  • Save marti1125/ebab992a64802de51764 to your computer and use it in GitHub Desktop.
Save marti1125/ebab992a64802de51764 to your computer and use it in GitHub Desktop.
cambiarLetras
function cambiarLetras(letra){
var resultado = letra.replace(/Á|_/g, "Á").replace(/á|_/g, "á")
.replace(/É|_/g, "É").replace(/é|_/g, "é")
.replace(/Í|_/g, "Í").replace(/í|_/g, "í")
.replace(/Ó|_/g, "Ó").replace(/ó|_/g, "ó")
.replace(/Ú|_/g, "Ú").replace(/ú|_/g, "ú")
.replace(/ñ|_/g, "ñ").replace(/Ñ|_/g, "Ñ")
.replace(/´|_/g, "´").replace(/ý|_/g, "ý")
.replace(/Ý|_/g, "Ý");
return resultado;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment