删除字符串左右两端空格

function trim(str){  //删除左右两端的空格
return str.replace(/(^\s*)|(\s*$)/g, "");
}

猜你喜欢

转载自fsi199773-163-com.iteye.com/blog/1147534