Created
November 21, 2019 04:45
-
-
Save tautologico/ab4c8c808f52c92b668f66b84dd66682 to your computer and use it in GitHub Desktop.
Remove acute accents in a string, if they're represented as separate characters
This file contains 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
// removes acute accents represented in separate characters | |
// e.g. a + ' = á | |
function removeAcute(s) { | |
let res = "" | |
let i = 0 | |
for (i = 0; i < s.length; ++i) { | |
if (s.codePointAt(i) != 769) | |
res = res + s.charAt(i) | |
} | |
return res | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment