In JavaScript, I would like to remove accent and diacritic only on capital letters:
- À => A
- Î => I
- Ï => I
- Ô => O
- …
I need to keep the lower case letters:
- à => à
- î => î
- …
Is there a better way than testing each letter individually?
In JavaScript, I would like to remove accent and diacritic only on capital letters:
I need to keep the lower case letters:
Is there a better way than testing each letter individually?
2
Answers
This is still kind of checking every letter, but I would just create a function that uses regex to do this, as it makes it much easier to manage.
For example
Remove diacritics from cappital letters using regex and normalize