js去空格之重写trim方法
重写后的trim方法可以去 与' '空格
String.prototype.trim = function() {
return this.replace(/^[\s\u3000\xa0]+|[\s\u3000\xa0]+$/g,"");
}
重写后的trim方法可以去 与' '空格
String.prototype.trim = function() {
return this.replace(/^[\s\u3000\xa0]+|[\s\u3000\xa0]+$/g,"");
}
暂无评论。
评论功能维护中,当前仅展示历史评论。