【发布时间】:2011-12-29 03:23:24
【问题描述】:
我不确定 JSON 值中是否允许换行。我当然无法在 JSON 中创建以下内容
{"foo": "I am not sure if line breaks are
allowed in JSON values. I certainly
am unable to create the following in JSON"}
下面的肯定不行
{"foo": "I am not sure if line breaks are\nallowed in JSON values. I certainly\nam unable to create the following in JSON"}
序言:我想向浏览器或控制台应用程序发送一条像上面这样的长消息,并以整齐的格式显示它,以便用户可以阅读。
【问题讨论】:
-
查看类似的SO question answered
-
你有办法解决这个问题吗?
标签: json newline line-breaks