list class : Insert(int,class) method

Description

Inserts an element at the specified index.

Syntax

listInstance.Insert(int index, someClass element)

Arguments

ClassNameDescription
intindexIndex to insert.
someClasselementElement to be inserted.

Return value

None

Sample code

//anyList is a instance of list{string} type.

anyList.Insert(0,"ww");

Notes

It's a wrapper of the System.Collections.Generic.List<t>.Insert(Int32,T).

The index is 0-based.

Links for reference

Copyright © Rice All rights reserved.