Inserts an item to the List at the specified position.
- index
- The zero-based index at which item is to be inserted.
- item
- The item to insert. (item can be null if T is a reference type.)
Type Reason ArgumentOutOfRangeException index is less than 0.
-or-
index is greater than stem.Collections.Generic.List<T>.Count.
List<T> accepts null as a valid value for reference types and allows duplicate elements.
If List<T>.Count already equals List<T>.Capacity, the capacity of the List is increased.
If index is equal to List<T>.Count, item is added to the end of list.
Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0