0 points

Strip Whitespace From String


dashboard

Fri May 29 2020 12:54:08 GMT+0000 (UTC)

Posted by @Amna #javascript

var str = " a b    c d e   f g   ";
var newStr = str.trim();
// "a b    c d e   f g"
content_copy Copy

https://css-tricks.com/snippets/javascript/strip-whitespace-from-string/