JS替换空格回车换行符时间:2023-03-09 13:02:57 JS替换空格回车换行符 str=str.replace(/\r/g," ") str=str.replace(/\n/g,"<br />") 或 str=str.replaceAll(" ","")