From ec93bb3c565ef1935673ace344aa7016c3f24852 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Sun, 4 Oct 2020 16:42:30 +0300 Subject: [PATCH] Update removeAccents.md --- snippets/removeAccents.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/snippets/removeAccents.md b/snippets/removeAccents.md index 6b49ba389..ea5d0ec1d 100644 --- a/snippets/removeAccents.md +++ b/snippets/removeAccents.md @@ -5,11 +5,11 @@ tags: string,beginner Removes accents from strings. -- Converts the string to a normalized Unicode format. -- The diacritical marks are represented by an Unicode range and are replaced by empty 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. ```js -const removeAccents = string => string.normalize("NFD").replace(/[\u0300-\u036f]/g, "") +const removeAccents = str => str.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); ``` ```js