Question : string methods to remove whitespace at the beginning and end of strings
Answered by : smiling-skunk-96ktnmjgs6m9
let hello = " Hello, World! ";
let wsRegex = /^\s+|\s+$/g; // Change this line
let result = hello.replace(wsRegex, ""); // Change this line
Source : https://forum.freecodecamp.org/t/freecodecamp-challenge-guide-remove-whitespace-from-start-and-end/301362 | Last Update : Sun, 24 Apr 22