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
转载于:https://www.cnblogs.com/ccyq/p/11294595.html