解决trim兼容性

String.prototype.trim = function() {
 return this.replace(/^\s*/g, "").replace(/\s*$/g, "");
};

原文地址:https://www.cnblogs.com/qiuh/p/3085674.html