Sample code for 30+ languages & platforms
VB.NET

Copy JSON Object from one JSON Array to Another

See more JSON Examples

Demonstrates how to copy an object in a JSON array to another JSON array.

Chilkat VB.NET Downloads

VB.NET
Dim arr1 As New Chilkat.JsonArray
Dim arr2 As New Chilkat.JsonArray

Dim s As String = "[{""a"":1}, {""b"":2}, {""c"":3}]"
Dim sEmpty As String = "[]"

arr1.Load(s)
arr2.Load(sEmpty)

Dim jObj As New Chilkat.JsonObject
arr1.ObjectAt2(1,jObj)

arr2.AddObjectCopyAt(-1,jObj)

Debug.WriteLine(arr2.Emit())

' output is:   [{"b":2}]