CommaDelimitedStringCollection.Insert(Int32, String) 方法

定义

将一个字符串元素添加到集合中的指定索引位置。Adds a string element to the collection at the specified index.

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

集合中将添加新元素的索引位置。The index in the collection at which the new element will be added.

value
String

要添加到集合中的新元素的值。The value of the new element to add to the collection.

示例

下面的代码示例演示如何使用 Insert 方法。The following code example demonstrates how to use the Insert method. 此代码示例是为类概述提供的更大示例的一部分 CommaDelimitedStringCollectionThis code example is part of a larger example provided for the CommaDelimitedStringCollection class overview.

// 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 属性设置为 trueThis method causes the IsModified property to be set to true.

适用于