Menu

gitpiper

removeAccents javascript Code Snippet in 2024

stringbeginner

Last Updated: 14 April 2024

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 April 2024

Subscribe to our Newsletter

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

© 2024 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! ✌️