删除左右两端空格

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

posted @ 2013-04-25 09:58  NewObject_1  阅读(141)  评论(0)    收藏  举报