Question : remove whitespace with regex javascript
Answered by : daniel-hemmati
return str.replace(/\s/g, '');
Source : https://stackoverflow.com/questions/7151159/javascript-regular-expression-remove-spaces | Last Update : Sun, 06 Dec 20
Question : JavaScript Regex - Remove Whitespace from Start and End
Answered by : abdelhadi-belaid
let hello = " Hello, World! ";
let wsRegex = /^\s+|\s+$/g;
let result = hello.replace(wsRegex, "");
Source : | Last Update : Fri, 11 Feb 22
Question : Remove whitespace from string javascript
Answered by : you
const str = "Hello, World! ";
const removedWhiteSpace = str.replace(/\s/g, "");
console.log(removedWhiteSpace); // Output: "Hello,World!"
Source : | Last Update : Tue, 19 Sep 23
Question : regex to ignore white spaces js
Answered by : rafiul-awal
myString.replace(/\s*/g,"")
Source : https://stackoverflow.com/questions/4590298/how-to-ignore-whitespace-in-a-regular-expression-subject-string | Last Update : Wed, 10 Nov 21