Tell us what’s happening:
I am stuck with this and tried several Regex to solve this code.
Your code so far
let hello = " Hello, World! "; let wsRegex = /^\s*\s*$/; // Change this line let result = hello.replace(wsRegex, ''); // Change this line
I also tried /^\s*$/ to try and match whitespace at the beginning and the end but it’s not working. Please give me a hint.
Your browser information:
User Agent is:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36.