function noSpace(x){
   if(x.match(/\s*/g)){
     return x.replace(/\s*/g,"");
   }else{
     return x;
   }
}

---

function noSpace(x){
  return x.replace(/\s/g, '');
}

---

function noSpace(x){
  var result = ""
  for(var index = 0; index < x.length; index++){
    if(x[index] !== " "){
      result += x[index];
    }
  }
  return result;
}

---

function noSpace(x){
   return x.replace(/ /g,'')
}

---

function noSpace(x){
  return x.split("")
    .map(function(val){
      return val == " "?"":val
    })
    .join("");
}

相关文章:

  • 2021-07-20
  • 2022-02-11
  • 2021-08-04
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
相关资源
相似解决方案