Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(Excel) JSON: Renaming and Deleting MembersDemonstrates renaming and deleting members. This example uses the following JSON document: { "apple": "red", "lime": "green", "banana": "yellow", "broccoli": "green", "strawberry": "red" }
Dim json As Chilkat.JsonObject Set json = Chilkat.NewJsonObject success = json.Load("{""apple"": ""red"",""lime"": ""green"",""banana"": ""yellow"",""broccoli"": ""green"",""strawberry"": ""red""}") If (success <> True) Then Debug.Print json.LastErrorText Exit Sub End If ' Rename "lime" to "lemon". success = json.Rename("lime","lemon") ' Change the color to yellow: success = json.SetStringOf("lemon","yellow") ' Rename by index. Banana is at index 2 (apple is at index 0) success = json.RenameAt(2,"bartlett_pear") ' Delete broccoli by name success = json.Delete("broccoli") ' Delete apple by index. Apple is at index 0. success = json.DeleteAt(0) json.EmitCompact = False Debug.Print json.Emit() |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.