JS 替换字符串中包含的所有的空格,或其他字符 <script> var start = '11-11-21'; start = start.replace(/-/gm,''); alert(start); </script> 显示结果为111121