C# | Check if the StringCollection is read-only Last Updated : 01 Feb, 2019 Comments Improve Suggest changes Like Article Like Report 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.IsReadOnly property is used to get a value indicating whether the StringCollection is read-only or not. Syntax: public bool IsReadOnly { get; } Return Value: This property always returns false. Note: A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created. Retrieving the value of this property is an O(1) operation. Example: CSHARP // C# code to check if the // StringCollection is read-only using System; using System.Collections; using System.Collections.Specialized; class GFG { // Driver code public static void Main() { // creating a StringCollection named myCol StringCollection myCol = new StringCollection(); // creating a string array named myArr String[] myArr = new String[] { "A", "B", "C", "D", "E" }; // Copying the elements of a string // array to the end of the StringCollection. myCol.AddRange(myArr); // checking if StringCollection is // read-only Console.WriteLine(myCol.IsReadOnly); } } Output: False Reference: https://docs.microsoft.com/en-us/dotnet/api/system.collections.specialized.stringcollection.isreadonly?view=netframework-4.7.2 Comment More infoAdvertise with us Next Article C# | Check if the StringCollection is read-only S Sahil_Bansall Follow Improve Article Tags : C# CSharp-Collections-Namespace CSharp-Specialized-Namespace CSharp-Specialized-StringCollection Similar Reads C# | Check if StringCollection is synchronized (thread safe) 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.IsSynchronized property is used to get a value indicating whether access to the St 1 min read C# | Check if the specified string is in the StringCollection 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.Contains(String) method is used to check whether the specified string is in the St 2 min read C# | Check if a SortedList is read-only SortedList class is a collection of (key, value) pairs which are sorted according to keys. Those pairs can be accessible by key and as well as by index(zero-based indexing). This comes under System.Collections namespace. SortedList.IsReadOnly property is used to get a value which indicates that a So 2 min read C# | Check if two StringCollection objects are equal Equals(Object) Method which is inherited from the Object class is used to check if a specified StringCollection object is equal to another StringCollection object or not. Syntax: public virtual bool Equals (object obj); Here, obj is the object which is to be compared with the current object. Return 2 min read C# | Check if the BitArray is read-only The BitArray class manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on i.e, 1 and false indicates the bit is off i.e, 0. This class is contained in System.Collections namespace. BitArray.IsReadOnly property is used to get a value indicati 2 min read Like