JS prototype 属性

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

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