js自定义方法--trim

String.prototype.trim = function(){
  return this.replace(/(^s*)|(s*$)/g, "");
}
posted @ 2011-07-13 17:47  拉登不开心  阅读(174)  评论(0编辑  收藏  举报