JsonArray.Insert Method
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Insert a JSON CLR type into the array at a specified index.
Namespace: System.Json
Assembly: System.Json (in System.Json.dll)
Syntax
'Declaration
Public Sub Insert ( _
index As Integer, _
item As JsonValue _
)
public void Insert(
int index,
JsonValue item
)
Parameters
- index
Type: System.Int32
The zero-based index at which the item should be inserted.
- item
Type: System.Json.JsonValue
The JsonValue object to insert.
Implements
Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | items is less than zero or larger than the size of the array. |
Remarks
Note that nulla null reference (Nothing in Visual Basic) is a valid value for item and that duplicate elements are allowed. If the insertion exceeds the capacity of the JsonArray, its size is automatically increased by reallocating the internal array, and the existing elements are copied to the new array before the new element is added. If index is equal to Count, item is added to the end of JsonArray.
Version Information
Silverlight
Supported in: 5, 4, 3
Platforms
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.