List<T>.IList.Insert(Int32, Object) Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Insère un élément dans l’index IList spécifié.
virtual void System.Collections.IList.Insert(int index, System::Object ^ item) = System::Collections::IList::Insert;
void IList.Insert(int index, object item);
abstract member System.Collections.IList.Insert : int * obj -> unit
override this.System.Collections.IList.Insert : int * obj -> unit
Sub Insert (index As Integer, item As Object) Implements IList.Insert
Paramètres
- index
- Int32
Index de base zéro auquel item doit être inséré.
Implémente
Exceptions
index n’est pas un index valide dans le IList.
item est d’un type qui n’est pas assignable au IList.
Remarques
Si index elle est égale au nombre d’éléments dans le IList, elle item est ajoutée à la fin.
Cette méthode est une opération O(n), où n est Count.