Is it possible to clear a line by removing duplicate spaces, tabs and line breaks, in general so that the line is like this:
var str = "test test test test";
and became such
var str = "test test test test";
I know $.trim
in jQuery
for this, but it will simply remove the spaces at the end and at the beginning of the line.
Can a plugin have any, or a function?