From 41041bb54d45da82b2179caef1a25ade7a8c48e0 Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Wed, 20 Dec 2017 10:33:07 +0530 Subject: [PATCH] updated discription --- snippets/stringToArrayOfWords.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/stringToArrayOfWords.md b/snippets/stringToArrayOfWords.md index d0cea5793..2749a6869 100644 --- a/snippets/stringToArrayOfWords.md +++ b/snippets/stringToArrayOfWords.md @@ -2,7 +2,7 @@ Converts a given string into an array of words -First create an array of dirt that you want to remove from the string. Then replace each dirt with an empty string. Use `String.split(' ')` to conver the string to an array with the space as a delimiter. +First create an array of dirt that you want to remove from the string. Then replace each dirt with an empty string. Use `String.split(/[\W_]+/)` to convert the string to an array with the use of regex. ```js const stringToArrayOfWords = str => {