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

que Object se va a agregar al final de .StringCollection El valor puede ser null.

Devoluciones

Índice StringCollection en el value que se ha agregado .

Implementaciones

Excepciones

es StringCollection de solo lectura.

O bien

StringCollection tiene un tamaño fijo.

Comentarios

StringCollection acepta null 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 de 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