ie8 不支持 trim方法

那就自己写一个trim() 
String.prototype.trim = function() {
                return this.replace(/(^\s*)|(\s*$)/g, ""); //正则匹配空格  
   }
posted @ 2020-03-26 14:45  J__F  阅读(157)  评论(0编辑  收藏  举报