UnitUnit1;InterfaceusesWindows, Messages, sysutils, variants, Classes, Graphics, Controls, Forms, Dialogs, Stdctrls;typeTForm1 =class(Tform) Button1:tbutton; Button2:tbutton;procedureButton1Click (Sender:tobject);procedureButton2click (Sender:tobject);End;varForm1:tform1;Implementation{$R *.DFM}usesSuperobject;//formatprocedureTform1.button1click (Sender:tobject);varJo:isuperobject;beginJO: = SO (' {' name ': ' Zhang San ', ' Age ': "," "Tel": ["111,222"], "children": {"name": "Zhang Following"}} '); ShowMessage (Jo. Format (' name:%Name%; Age:%age% ')); ShowMessage (Jo. Format ('%tel%;%tel[0]%;%tel[1]% ')); ShowMessage (Jo. Format ('%children%;%children.name% ')); ShowMessage (Jo. Format (' [Name], [age] ',' [','] '));{The default% tag can be replaced}End;//Special charactersprocedureTform1.button2click (Sender:tobject);varJo:isuperobject;beginJO: = so;{\u}JO: = SO (' "\u0041\u0042\u0043" '); ShowMessage (Jo. asstring);{\x}JO: = SO (' "\x41\x42\x43" '); ShowMessage (Jo. asstring);{\u Kanji}JO: = SO (' "\u4e07\u4e00" '); ShowMessage (Jo. asstring);{The number after \u can be capitalized}JO: = SO (' "\u4e07\u4e00" '); ShowMessage (Jo. asstring);{\ \ \/}JO: = SO (' "a\\b\/c" '); ShowMessage (Jo. asstring);{\ t, \ n and \b, \f, \ r}JO: = SO (' "A\tb\nc" '); ShowMessage (Jo. asstring);{ \"" }JO: = SO (' "\" abc\ "" '); ShowMessage (Jo. asstring);{Null is a data type of JSON, representing null values, and null values are also one of the values}JO: = SO (' [1,2,3,null] '); ShowMessage (Jo. asstring);End;End.
JSON Superobject (5): Format with escape character