js中去除换行(\r\n)
解决方法:replace(/\r\n/g,"").replace("\n","")
测试:
<script> var str = "a\r\nb\r\nc"; alert(str); str = str.replace(/\r\n/g,""); alert(str); </script>
解决方法:replace(/\r\n/g,"").replace("\n","")
测试:
<script> var str = "a\r\nb\r\nc"; alert(str); str = str.replace(/\r\n/g,""); alert(str); </script>