function trim(str){
str = str.replace(/^\s+/,"");
str = str.replace(/\s+$/,"");
return str;
}
function trim(str){
str = str.replace(/^\s+/,"");
str = str.replace(/\s+$/,"");
return str;
}
转载于:https://www.cnblogs.com/taolixia/p/7143354.html