~function(pro){
function mytrim() {
return this.replace(/^ +| +$/g,'');
}
pro.mytrim = mytrim;
}(String.prototype);
~function(pro){
function mytrim() {
return this.replace(/^ +| +$/g,'');
}
pro.mytrim = mytrim;
}(String.prototype);
本文标题:自实现string的trim()方法
本文链接:https://www.haomeiwen.com/subject/qpdhfxtx.html
网友评论