JS替换空格回车换行符 str=str.replace(/\r/g," ") str=str.replace(/\n/g,"<br />") 或 str=str.replaceAll(" ","") 转载于:https://www.cnblogs.com/as3lib/p/6800449.html