通过


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

适用于