StringCollection.AddRange Method (String[])


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Copies the elements of a string array to the end of the StringCollection.

Namespace:   System.Collections.Specialized
Assembly:  System (in System.dll)

member AddRange : 
        value:string[] -> unit


Type: System.String[]

An array of strings to add to the end of the StringCollection. The array itself can not be null but it can contain elements that are null.

Exception Condition

value is null.

StringCollection accepts null as a valid value and allows duplicate elements.

If the StringCollection can accommodate the new elements without increasing the capacity, this method is an O(n) operation, where n is the number of elements to be added. If the capacity needs to be increased to accommodate the new elements, this method becomes an O(n + m) operation, where n is the number of elements to be added and m is Count.

The following code example adds new elements to the StringCollection.

No code example is currently available or this language may not be supported.

Universal Windows Platform
Available since 10
.NET Framework
Available since 1.1
Return to top