次の方法で共有


CommaDelimitedStringCollection.Insert(Int32, String) メソッド

定義

指定したインデックス位置にあるコレクションに文字列要素を追加します。

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)

パラメーター

index
Int32

新しい要素が追加されるコレクション内のインデックス。

value
String

コレクションに追加する新しい要素の値。

次のコード例は、 Insert メソッドの使用方法を示しています。 このコード例は、 CommaDelimitedStringCollection クラスの概要に関するより大きな例の一部です。

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

注釈

このメソッドにより、 IsModified プロパティが true に設定されます。

適用対象