JavaScript tips
Posted on 2018-03-07 in Trucs et astuces
Sommaire
Normalize an UTF-8 string
Rely on String.prototype.normalize().
const str = "Crème Brulée" str.normalize('NFD').replace(/[\u0300-\u036f]/g, "") > 'Creme Brulee'
Posted on 2018-03-07 in Trucs et astuces
Sommaire
Rely on String.prototype.normalize().
const str = "Crème Brulée" str.normalize('NFD').replace(/[\u0300-\u036f]/g, "") > 'Creme Brulee'