Created
September 15, 2019 21:06
-
-
Save marydn/666b7c4a84cfbfde19d7ac6193fe9030 to your computer and use it in GitHub Desktop.
Remove accents/diacritics in a string in JavaScript
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
const str = "Crème Brulée" | |
str.normalize("NFD").replace(/[\u0300-\u036f]/g, "") | |
// > "Creme Brulee" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment