对string对象进行扩展,使其具有删除前后空格的方法

106 阅读1分钟
String.prototype.trim = function() {
return	 this.replace(/(^\s*)|(\s*$)/g, "");
}