1
2
3
4
5 |
<script> var
start = ‘11-11-21‘ ; start = start.replace(/-/gm, ‘‘ ); alert(start); </script> |
显示结果为111121
JS 替换字符串中包含的所有的空格,或其他字符,布布扣,bubuko.com
原文:http://www.cnblogs.com/liang-ling/p/3672484.html