replace multiple spaces with single space javascript
snippet in javascript

replace multiple spaces with single space javascript

user877

string = string.replace(/\s\s+/g, ' ');