CommaDelimitedStringCollection.AddRange(String[]) 方法

定义

将字符串数组中的所有字符串添加到集合中。Adds all the strings in a string array to the collection.

public:
 void AddRange(cli::array <System::String ^> ^ range);
public void AddRange (string[] range);
override this.AddRange : string[] -> unit
Public Sub AddRange (range As String())

参数

range
String[]

要添加到集合中的字符串数组。An array of strings to add to the collection.

示例

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

// Add values to the CommaDelimitedStringCollection object.
myStrCollection.AddRange(
  authorizationRuleCollection.Get(i).Users.ToString().Split(
  ",".ToCharArray()));
' Add values to the CommaDelimitedStringCollection object.
myStrCollection.AddRange( _
  authorizationRuleCollection.Get(i).Users.ToString().Split( _
  ",".ToCharArray()))

注解

range参数必须是一个数组,而不是以逗号分隔的字符串。The range parameter must be an array rather than a comma-delimited string.

适用于