素材巴巴 > 程序开发 >

js将字符串换行

程序开发 2023-09-23 14:36:31
var test = "测试一下换行n不知道行不行n看结果";
 while (test.indexOf("\n") >= 0) { var test = test.replace("\n", " n "); }
 console.log(test);


标签:

素材巴巴 Copyright © 2013-2021 http://www.sucaibaba.com/. Some Rights Reserved. 备案号:备案中。