阅读:4128回复:0
js将字符串换行var test = "测试一下换行\n不知道行不行\n看结果"; while (test.indexOf("\\n") >= 0) { var test = test.replace("\\n", " \n "); } console.log(test); https://blog.csdn.net/skye_95/article/details/84348649?utm_term=js%E5%AD%97%E7%AC%A6%E4%B8%B2%E8%87%AA%E5%8A%A8%E6%8D%A2%E8%A1%8C&utm_medium=distribute.pc_aggpage_search_result.none-task-blog-2~all~sobaiduweb~default-9-84348649&spm=3001.4430 |
|