-
-
Save vhsu/ea1e832262265b93d87528819caa1062 to your computer and use it in GitHub Desktop.
JAVASCRIPT:Remove Accents
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Lowercase Only Version | |
function RemoveAccents(strAccents) { | |
var strAccents = strAccents.split(''); | |
var strAccentsOut = new Array(); | |
var strAccentsLen = strAccents.length; | |
var accents = 'àáâãäåòóôõöøèéêëðçÐìíîïùúûüñšÿýž'; | |
var accentsOut = "aaaaaaooooooeeeeecdiiiiuuuunsyyz"; | |
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