对string对象进行扩展,使其具有删除前后空格的方法 努力1 2019-07-06 106 阅读1分钟 String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); }