JS prototype 属性

String.prototype.trim=function(){
  return this.replace(/(^\s*)|(\s*$)/g, "");
}

posted @ 2016-02-09 09:20  汉城  阅读(143)  评论(0)    收藏  举报