添加以下代码以向字符串添加修剪功能。
if(typeof String.prototype.trim !== 'function') { String.prototype.trim = function() { return this.replace(/^s+|s+$/g, ''); }}
添加以下代码以向字符串添加修剪功能。
if(typeof String.prototype.trim !== 'function') { String.prototype.trim = function() { return this.replace(/^s+|s+$/g, ''); }}