Created
June 12, 2020 09:53
-
-
Save kubadlo/ef5ef48000ccfc2b7a43bbb05fece03d to your computer and use it in GitHub Desktop.
Remove accents/diacritics in a string in JavaScript
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
const str = "ščíáýžľčéíľšéíľéšíťč"; | |
str.normalize('NFD').replace(/[\u0300-\u036f]/g, ""); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment