C# StringCollection StringCollection
Description
StringCollection StringCollection
initializes a new
instance of the StringCollection class.
Syntax
StringCollection.StringCollection
has the following syntax.
public StringCollection()
Example
using System;//from w w w. j av a 2 s.c o m
using System.Collections;
using System.Collections.Specialized;
public class SamplesStringCollection {
public static void Main() {
StringCollection myCol = new StringCollection();
String[] myArr = new String[] { "A", "B", "C", "java2s.com"};
myCol.AddRange( myArr );
Console.WriteLine( myCol.Count);
}
}
The code above generates the following result.