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>
时间: 2024-10-24 20:30:57
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>