去掉左右空格
String.prototype.trim=function (){return this.replace(/(^\s*)|(\s*$)/g,'');}
去掉全部空格:String.prototype.mm = function (){return this.replace(/\s/g, '');}