Menu

gitpiper

removeAccents javascript Code Snippet in 2022

stringbeginner

Last Updated: 25 September 2022

Removes accents from strings.

  • Use String.prototype.normalize() to convert the string to a normalized Unicode format.
  • Use String.prototype.replace() to replace diacritical marks in the given Unicode range by empty strings.
const removeAccents = str => str.normalize('NFD').replace(/[\u0300-\u036f]/g, '');
removeAccents('Antoine de Saint-Exupéry'); // 'Antoine de Saint-Exupery'

javascript snippet similar to removeAccents For You in September 2022

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2022 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️