I have strings with extra whitespaces, each time there's more than only one whitespace I'd like it be only one.
Anyone? I tried searching google, but nothing worked for me.
Thanks
Something like this:
var s = " a b c ";
console.log(
s.replace(/\s+/g, ' ')
)