在String的原型上实现去掉字符串中的空白字符
String.prototype.nospace = function(){
return this.replace(/\s/g,"")
}
var str = " hello world ";
console.log(str.nospace()); //helloworld
String.prototype.nospace = function(){
return this.replace(/\s/g,"")
}
var str = " hello world ";
console.log(str.nospace()); //helloworld