Sample code for 30+ languages & platforms
PowerShell Requires Chilkat v9.5.0.67+

JSON Append String Array

See more JSON Examples

Demonstrates how to append an array of strings from a string table object.

Chilkat PowerShell Downloads

PowerShell
Add-Type -Path "C:\chilkat\ChilkatDotNet47-x64\ChilkatDotNet47.dll"

$json = New-Object Chilkat.JsonObject
$json.EmitCompact = $false

$json.AppendString("abc","123")

$st = New-Object Chilkat.StringTable
$st.Append("a")
$st.Append("b")
$st.Append("c")
$st.Append("d")

$json.AppendStringArray("strArray",$st)

$($json.Emit())

#  Output:

#  	{
#  	  "abc": "123",
#  	  "strArray": [
#  	    "a",
#  	    "b",
#  	    "c",
#  	    "d"
#  	  ]
#  	}