Answers for "js replace diacritics"

0

js replace diacritics

// this will keep symbols
console.log( "âîÂșț12@.".normalize('NFD').replace(/[\u0300-\u036f]/g, "") );
//output: aiAst12@.

console.log( "âîÂșț12@.".normalize('NFKD').replace(/[^\w]/g, '') );
// output: aiAst12
Posted by: Guest on May-05-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language