Skip to content

Instantly share code, notes, and snippets.

@AlbinSoft
Created November 27, 2024 08:16
Show Gist options
  • Select an option

  • Save AlbinSoft/6632f352e6f1de6b87c04331b202e67a to your computer and use it in GitHub Desktop.

Select an option

Save AlbinSoft/6632f352e6f1de6b87c04331b202e67a to your computer and use it in GitHub Desktop.
Comparing strings in Javascript althought having latin 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