JSON superobject (7): Double quotation marks that can be omitted

Source: Internet
Author: User
In JSON, the string should be in double quotation marks. It was found from the previous example that the double quotation marks can be omitted and can be omitted with spaces.

Of course, onlyProgramCodeCan be omitted, the object will automatically identify the added.

In this case, the following methods can be used:

Uses superobject; Procedure tform1.button1click (Sender: tobject); var jo1, JO2, jo3: isuperobject; begin jo1: = So ('{"name": "zhangsan", "Age ": "Li Si"} '); showmessage (jo1.asjson (false, false); JO2: = So (' {Name: Zhang San, age: Li Si }'); showmessage (jo2.asjson (false, false); jo3: = So ('{name 1: Three, age 2: Li Si}'); showmessage (jo3.asjson (false, false); {If double quotation marks are not used, the leading and trailing spaces are also recognized; or double quotation marks should be used whenever possible} end;

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.