string(字符串类型)的各个方法总结 let str = " a b c "; 1:取掉字符串中的首尾空格: console.log("trim",str.trim());2:取掉字符串中的所有空格: str.replace(/s/ig,'')