function trim(str) {
if (str && typeof str === "string")
{ return str.replace(/(^\s*)|(\s*)$/g,""); //去除前后空白符 }
}
function trim(str) {
if (str && typeof str === "string")
{ return str.replace(/(^\s*)|(\s*)$/g,""); //去除前后空白符 }
}
转载于:https://www.cnblogs.com/RonnieQin/p/8466010.html