Inserts the elements of a collection into the
ListT at the specified index.
Namespace: System.Collections.GenericAssembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax public void InsertRange(
int index,
IEnumerable<T> collection
)
Parameters
- index
- Type: SystemInt32
The zero-based index at which the new elements should be inserted. - collection
- Type: System.Collections.GenericIEnumerableT
The collection whose elements should be inserted into the ListT. The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type.
Exceptions Exception | Condition |
---|
ArgumentNullException | collection is null. |
ArgumentOutOfRangeException | index is less than 0.-or-index is greater than Count. |
See Also