<script>
        window.onload=function(){
            var a = "杭州      上海 合肥"
            var b = a.replace(/\s+/g,",");
            alert(b)
        }
    </script>

结果:杭州,上海,合肥

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2022-12-23
  • 2021-09-06
  • 2021-11-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
  • 2021-10-18
相关资源
相似解决方案