how to trim more than one space and new line in between string in javascript? code example
Example: replace multiple spaces with single space javascript
string = string.replace(/\s\s+/g, ' ');
string = string.replace(/\s\s+/g, ' ');