Created
June 8, 2018 02:34
-
-
Save caioregatieri/ae36974bf94a4c2558fa7b3564fa6bd7 to your computer and use it in GitHub Desktop.
remove_acentos.js
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
function removeAcento (text) | |
{ | |
text = text.toLowerCase(); | |
text = text.replace(new RegExp('[ÁÀÂÃ]','gi'), 'a'); | |
text = text.replace(new RegExp('[ÉÈÊ]','gi'), 'e'); | |
text = text.replace(new RegExp('[ÍÌÎ]','gi'), 'i'); | |
text = text.replace(new RegExp('[ÓÒÔÕ]','gi'), 'o'); | |
text = text.replace(new RegExp('[ÚÙÛ]','gi'), 'u'); | |
text = text.replace(new RegExp('[Ç]','gi'), 'c'); | |
return text; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment