From 0498e27902bb8d355d3bb381bc1ba9a445d81fc5 Mon Sep 17 00:00:00 2001 From: Hassaan Pasha Date: Wed, 12 Feb 2020 11:47:54 +0500 Subject: [PATCH] =?UTF-8?q?fix:=20added=20white=20space=20checks=20includi?= =?UTF-8?q?ng=20newlines=20to=20ensure=20pro=E2=80=A6=20(#38166)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: added white space checks including newlines to ensure proper validation of trim method * fix: Addressing comments --- .../remove-whitespace-from-start-and-end.english.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md index a85d677587..e198232222 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/regular-expressions/remove-whitespace-from-start-and-end.english.md @@ -13,7 +13,7 @@ Sometimes whitespace characters around strings are not wanted but are there. Typ ## Instructions
Write a regex and use the appropriate string methods to remove whitespace at the beginning and end of strings. -Note
The .trim() method would work here, but you'll need to complete this challenge using regular expressions. +Note: The String.prototype.trim() method would work here, but you'll need to complete this challenge using regular expressions.
## Tests @@ -23,8 +23,8 @@ Write a regex and use the appropriate string methods to remove whitespace at the tests: - text: result should equal to "Hello, World!" testString: assert(result == "Hello, World!"); - - text: You should not use the .trim() method. - testString: assert(!code.match(/\.trim\(.*?\)/)); + - text: Your solution should not use the String.prototype.trim() method. + testString: assert(!code.match(/\.trim\([\s\S]*?\)/)); - text: The result variable should not be set equal to a string. testString: assert(!code.match(/result\s*=\s*".*?"/));