写一个方法去掉字符串中的空格
2020-01-01 本文已影响0人
死敲代码的
var str = 'a bs sdf aasd';
console.log(trim(str));
function trim(str){
if(typeof str === 'string'){
return str.split(' ').join('');
}
}
var str = 'a bs sdf aasd';
console.log(trim(str));
function trim(str){
if(typeof str === 'string'){
return str.split(' ').join('');
}
}