截取字符串的首尾空格

function trim(str){
 return str.replace(/(^\s*)|(\s*$)/g, "");
}
posted @ 2009-02-10 16:57  枣阳人在深圳  阅读(154)  评论(0)    收藏  举报