小程序- 字符数据换行

获取接口的数据,如果有换行字符,转义的方式如下。

必须接口数据有换行符 /n 

txtresp.replace(/\\n/g,'\n');

 

posted @ 2026-06-25 16:58  微宇宙  阅读(2)  评论(0)    收藏  举报