StringCollection class is a new addition to the .NET Framework class library that represents a collection of strings. StringCollection class is defined in the System.Collections.Specialized namespace.
StringCollection.Add(String) Method is used to add a string to the end of the StringCollection.
public int Add (string value);
Here, value is the string to add to the end of the StringCollection. The value can be null.
Return Value: The zero-based index at which the new element is inserted.
Note: If Count is less than the capacity, this method is an O(1) operation. If the capacity needs to be increased to accommodate the new element, this method becomes an O(n) operation, where n is Count.
Below programs illustrate the use of StringCollection.Add(String) Method:
A B C D E
2 4 6 8 10