Skip to content

Instantly share code, notes, and snippets.

@9oelM
Forked from alisterlf/gist:3490957
Created January 13, 2021 15:55
Show Gist options
  • Save 9oelM/440720a4efd6641faedea90e14565ca2 to your computer and use it in GitHub Desktop.
Save 9oelM/440720a4efd6641faedea90e14565ca2 to your computer and use it in GitHub Desktop.
JAVASCRIPT:Remove Accents
function RemoveAccents(strAccents) {
var strAccents = strAccents.split('');
var strAccentsOut = new Array();
var strAccentsLen = strAccents.length;
var accents = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž';
var accentsOut = "AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz";
for (var y = 0; y < strAccentsLen; y++) {
if (accents.indexOf(strAccents[y]) != -1) {
strAccentsOut[y] = accentsOut.substr(accents.indexOf(strAccents[y]), 1);
} else
strAccentsOut[y] = strAccents[y];
}
strAccentsOut = strAccentsOut.join('');
return strAccentsOut;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment