如何在application / json文件中断行?

问题描述 投票:0回答:1

我有一个文本,想在其中打破行,格式为application / json。

我使用/ n但有时它似乎工作,其他没有。

{"Text":"# hi  \n\n::: red \n\nImportant  \n bye"}

谢谢

json line-breaks
1个回答
1
投票

\之前使用\n作为转义字符:

{"Text":"# hi  \\n\\n::: red \\n\\nImportant  \\n bye"}
© www.soinside.com 2019 - 2024. All rights reserved.