一、去除首尾空格
1.使用正则表达式
function Sw(str) { //去掉首尾两端的空格(^\s*)|(\s*$)
return str.replace(/(^\s*)|(\s*$)/g, "");
}
function Sw(str) { /一、去除首尾空格
1.使用正则表达式
function Sw(str) { //去掉首尾两端的空格(^\s*)|(\s*$)
return str.replace(/(^\s*)|(\s*$)/g, "");
}
function Sw(str) { /