How can I remove all extra space between words in a string literal?
\"some value\"
Should become
\"some value\" <
var str = " This should become something else too . " $.trim(str).replace(/\s(?=\s)/g,'')
This uses lookahead to replace multiple spaces with a single space.