StringCollection.IList.Add(Object) Método

Definición

Agrega un objeto al final de StringCollection.

 virtual int System.Collections.IList.Add(System::Object ^ value) = System::Collections::IList::Add;
int IList.Add (object value);
int IList.Add (object? value);
abstract member System.Collections.IList.Add : obj -> int
override this.System.Collections.IList.Add : obj -> int
Function Add (value As Object) As Integer Implements IList.Add

Parámetros

value
Object

Objeto Object que se va a agregar al final de la colección StringCollection. El valor puede ser null.

Devoluciones

Índice de StringCollection en el que se ha agregado value.

Implementaciones

Excepciones

StringCollection es de solo lectura.

o bien

StringCollection tiene un tamaño fijo.

Comentarios

StringCollectionnull acepta como un valor válido y permite elementos duplicados.

Si Count ya es igual a la capacidad, la capacidad de se incrementa mediante la reasignación automática de StringCollection la matriz interna y los elementos existentes se copian en la nueva matriz antes de agregar el nuevo elemento.

Si Count es menor que la capacidad, este método es una operación O(1). Si es necesario aumentar la capacidad para acomodar el nuevo elemento, este método se convierte en una operación O(n), donde n es Count.

Se aplica a

Consulte también