js扩展

1.去除字符串前置后置空格:

String.prototype.trimStr = function () {
    return this.replace(/^\s+|\s+$/g,'');
}

 

posted on 2018-04-30 12:04  月光glory  阅读(112)  评论(0)    收藏  举报

导航