Created
November 27, 2024 08:16
-
-
Save AlbinSoft/6632f352e6f1de6b87c04331b202e67a to your computer and use it in GitHub Desktop.
Comparing strings in Javascript althought having latin characters
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 a = someValueA.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase(); | |
| const b = someValueB.normalize('NFD').replace(/\p{Diacritic}/gu, '').toLowerCase(); | |
| if(a==b) return true; | |
| if(b.indexOf(a)>-1) return true; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment