去掉字符串的空格

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

posted @ 2019-04-19 13:50  hongsedigua  阅读(109)  评论(0编辑  收藏  举报