In C#, SortedList is a collection of key/value pairs which are sorted according to keys. By default, this collection sort the key/value pairs in ascending… Read More
Tag Archives: CSharp-Collections-SortedList
In C#, SortedList is a collection of key/value pairs which are sorted according to keys. By default, this collection sort the key/value pairs in ascending… Read More
SortedList.Clone() Method is used to create a shallow copy of a SortedList object. Syntax: public virtual object Clone(); Return Value: It returns a shallow copy… Read More
Equals(Object) Method which is inherited from the Object class is used to check whether the specified SortedList object is equal to another SortedList object or… Read More
SortedList.Synchronized(SortedList) Method is used to get the synchronized (thread-safe) wrapper for a SortedList object. Syntax: public static System.Collections.SortedList Synchronized (System.Collections.SortedList list); Here, list is the… Read More
SortedList.SetByIndex(Int32, Object) Method is used to replace the value at a specific index in a SortedList object. Syntax: public virtual void SetByIndex (int index, object… Read More
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… Read More
SortedList.IndexOfKey(Object) Method is used to get the zero-based index of the specified key in a SortedList object. Syntax: public virtual int IndexOfKey (object key); Here,… Read More
SortedList.IndexOfValue(Object) Method is used to get the zero-based index of the first occurrence of the specified value in a SortedList object. Syntax: public virtual int… Read More
SortedList.GetKeyList Method is used to get the list of keys in a SortedList object. Syntax: public virtual System.Collections.IList GetKeyList (); Return Value: It returns an… Read More
SortedList.TrimToSize Method is used to set the capacity to the actual number of elements in a SortedList object.Syntax: public virtual void TrimToSize (); Exception: This… Read More
SortedList.GetValueList Method is used to get the list of keys in a SortedList object. Syntax: public virtual System.Collections.IList GetValueList (); Return Value: It returns an… Read More
SortedList.Contains(Object) Method is used to check whether a SortedList object contains a specific key. Syntax: public virtual bool Contains (object key); Here, key is the… Read More
SortedList.GetEnumerator Method is used to an IDictionaryEnumerator object that iterates through a SortedList object. Syntax: public virtual System.Collections.IDictionaryEnumerator GetEnumerator (); Return Value: This method returns… Read More
SortedList.GetByIndex(Int32) Method is used to get the value at the specified index of a SortedList object. Syntax: public virtual object GetByIndex (int index); Here index… Read More