CommaDelimitedStringCollection.Insert(Int32, String) Metoda

Definicja

Dodaje element ciągu do kolekcji w określonym indeksie.

public:
 void Insert(int index, System::String ^ value);
public void Insert (int index, string value);
override this.Insert : int * string -> unit
Public Sub Insert (index As Integer, value As String)

Parametry

index
Int32

Indeks w kolekcji, w której zostanie dodany nowy element.

value
String

Wartość nowego elementu do dodania do kolekcji.

Przykłady

W poniższym przykładzie kodu pokazano, jak używać Insert metody . Ten przykład kodu jest częścią większego przykładu podanego CommaDelimitedStringCollection na potrzeby przeglądu klasy.

// Insert a new element in the collection.
myStrCollection.Insert(myStrCollection.Count, "userNameX");
' Insert a new element in the collection.
myStrCollection.Insert(myStrCollection.Count, "userNameX")

Uwagi

Ta metoda powoduje, że właściwość ma być ustawiona IsModified na truewartość .

Dotyczy