From a4d9656df1ac446cde14baa996516114c9dee836 Mon Sep 17 00:00:00 2001 From: Arjun Mahishi Date: Wed, 20 Dec 2017 00:28:34 +0530 Subject: [PATCH] Fixed typo and added another example --- snippets/stringToArrayOfWords.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/snippets/stringToArrayOfWords.md b/snippets/stringToArrayOfWords.md index 5cc742c60..851f93397 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 string to array with the space 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(' ')` to conver the string to an array with the space as a delimiter. ```js const stringToArray = str =>{ @@ -11,4 +11,5 @@ const stringToArray = str =>{ } // stringToArrayOfWords("I love javaScript!!") -> ["I", "love", "javaScript"] +// stringToArrayOfWords("python, javaScript & coffee") -> ["python", "javaScript", "coffee"] ``` \ No newline at end of file