From d39ac8bbce7e31dc0babebec27557559f83f978b Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Wed, 20 Dec 2017 12:34:03 +0530 Subject: [PATCH] updated description --- snippets/stringToArrayOfWords.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snippets/stringToArrayOfWords.md b/snippets/stringToArrayOfWords.md index f0c5f149b..4a7aa7c8a 100644 --- a/snippets/stringToArrayOfWords.md +++ b/snippets/stringToArrayOfWords.md @@ -2,11 +2,11 @@ Converts a given string into an array of words -Use `String.split(/[\W_]+/)` to convert the string to an array with the use of regex. +Use `String.split` to convert the string to an array. ```js const stringToArrayOfWords = (str, pattern = /[\W_]+/) => str.split(pattern).filter(Boolean) // stringToArrayOfWords("I love javaScript!!") -> ["I", "love", "javaScript"] // stringToArrayOfWords("python, javaScript & coffee") -> ["python", "javaScript", "coffee"] -``` \ No newline at end of file +```