如何将JSON对象中的文本字符串继续到另一行? [英] How can I continue a text string in a JSON object onto another line?
本文介绍了如何将JSON对象中的文本字符串继续到另一行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个这样定义的JSON对象:
I have a JSON object that I am defining like this:
"COVER": {
"H1": "XXX",
"P1": "Very long text" +
"More very long text"
}
我试图将文本分成两行,但收到一条Visual Studio错误消息,提示对象成员后缺少逗号"
I tried to split the text onto two lines but I get a Visual Studio error messages saying "missing a comma after an object member"
推荐答案
在编辑器/IDE中打开文本环绕.
Turn on text wrapping in your editor / IDE.
JSON不是JavaScript,而是数据.为此,拧紧数据完整性是没有意义的.启用自动换行/配置编辑器以漂亮地打印JSON是更好的选择.我个人更喜欢使用sublime文字3.
JSON isn't JavaScript, it's data. It doesn't make sense to screw around with your data integrity for this. Enabling word wrap / configuring your editor to pretty-print JSON are better options. I personally prefer sublime text 3 for working with it.
这篇关于如何将JSON对象中的文本字符串继续到另一行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文