So i'm writing a tiny little plugin for JQuery to remove spaces from a string. see here
(function($) { $.stripSpaces = function(str) { var reg = new RegExp("[ ]+","g"); return str.replace(reg,""); } })(jQuery); my regular expression is currently [ ]+ to collect all spaces. This works.. however It doesn't leave a good taste in my mouth.. I also tried [\s]+ and [\W]+ but neither worked..
There has to be a better (more concise) way of searching for only spaces.