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
Here is an alternate solution if you do not want to use replace (replace spaces in a string without using replace javascript)
var str="The dog has a long tail, and it is RED!"; var rule=/\s{1,}/g; str = str.split(rule).join(" "); document.write(str);