Given a string like:
\"The dog has a long tail, and it is RED!\"
What kind of jQuery or JavaScript magic can be used to keep spaces to only o
I have this method, I call it the Derp method for lack of a better name.
while (str.indexOf(" ") !== -1) { str = str.replace(/ /g, " "); }
Running it in JSPerf gives some surprising results.