Skip to content

Instantly share code, notes, and snippets.

@tautologico
Created November 21, 2019 04:45
Show Gist options
  • Save tautologico/ab4c8c808f52c92b668f66b84dd66682 to your computer and use it in GitHub Desktop.
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
// 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