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 accepts null as a valid value and allows duplicate elements.
- String comparisons are case-sensitive.
- Elements in this collection can be accessed using an integer index.
- Indexes in this collection are zero-based.
Below programs illustrate how to get or set the elements at the specified index in StringCollection:
- C# | Remove from the specified index of the StringCollection
- C# | Copy StringCollection at the specified index of array
- C# | Insert at the specified index in StringCollection
- C# | Gets or sets the element at the specified index in StringCollection
- C# | Check if the specified string is in the StringCollection
- C# | Index of first occurrence in StringCollection
- C# | Get the number of strings in StringCollection
- C# | Get an enumerator that iterates through StringCollection
- How to get Synchronize access to the StringCollection in C#
- C# | Get or set the element at specified index in Collection<T>
- C# | Get or set the element at the specified index in ArrayList
- Creating an Index From the Specified Index at the Start of a Collection in C#
- Creating an Index From the End of a Collection at a Specified Index Position in C#
- C# | Check if the StringCollection is read-only
- C# | Check if StringCollection is synchronized (thread safe)
- C# | Remove the first occurrence from the StringCollection
- C# | Remove all the strings from the StringCollection
- C# | Add a string to the end of the StringCollection
- C# | Copy the elements of a string array to the end of the StringCollection
- C# | StringCollection Class
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.