215
Something like this:
const str = " a b c "
const result = str.replace(/\s+/g, ' ').trim()
console.log('result', result)
console.log('result.length', result.length)
var x = " Test Test Test ".split(" ").join(""); alert(x);