自实现string的trim()方法

2017-05-28  本文已影响12人  SmallTwo
~function(pro){
        function mytrim() {
            return this.replace(/^ +| +$/g,'');
        }
        pro.mytrim = mytrim;
    }(String.prototype);
上一篇 下一篇

猜你喜欢

热点阅读