let trimStr = function (str) {
if (!str) return '';
str = str.toString();
return str.replace(/(^\s*)|(\s*$)/g, "");
};
console.log(trimStr(" js去掉头尾空白符 "))
let trimStr = function (str) {
if (!str) return '';
str = str.toString();
return str.replace(/(^\s*)|(\s*$)/g, "");
};
console.log(trimStr(" js去掉头尾空白符 "))