Inserts an Element into the array at the specified position.

 

   

Syntax
 

[C#]
virtual void Insert(int index, T value)

[Visual Basic]
Overridable Function Insert(index As int, value As T) As void

 

Throws Exceptions ArgumentOutOfRangeException: Thrown if the index provided is not valid.Throws Exceptions NullReferenceException: Thrown if an attempt is made to insert a null value in a non-Nullable array.

 

   

Params
 
Name Description
index The zero-based index at which value should be inserted.
value The Element to insert into the array.

 

   

Notes
 

Inserts an Element into the array at the specified position.

If the index equals the number of items in the array then the Element is appended to the end.

Most ArrayElements cannot hold null values in a meaningful way. So in general, if you provide a null value this will result in an exception being raised.

Occasionally it is appropriate for ArrayElements to hold null values represented as NullAtoms. You can indicate this is acceptable, by setting the Nullable property.

 

   

Example
 
None.