AmitDiwan has Published 10740 Articles

Remove all elements from OrderedDictionary in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 07:19:04

154 Views

To remove all elements from OrderedDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       OrderedDictionary dict = new OrderedDictionary();       dict.Add("A", "Books");       dict.Add("B", "Electronics");       dict.Add("C", "Smart ... Read More

Check if ListDictionary is synchronized in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 07:16:33

137 Views

To check if ListDictionary is synchronized, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       ListDictionary dict = new ListDictionary();       dict.Add("1", "SUV");       dict.Add("2", "Sedan");       dict.Add("3", "Utility ... Read More

Check if ListDictionary is read-only in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 07:12:55

163 Views

To check if ListDictionary is read-only, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       ListDictionary dict1 = new ListDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       dict1.Add("C", "Smart ... Read More

Remove all elements from a SortedList in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 07:07:13

184 Views

To remove all elements from a SortedList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       SortedList sortedList = new SortedList();       sortedList.Add("A", "1");       sortedList.Add("B", "2");       sortedList.Add("C", "3"); ... Read More

Remove all elements from a HashSet in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 07:04:01

239 Views

To remove all elements from a HashSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       HashSet set1 = new HashSet();       set1.Add("A");       set1.Add("B");       set1.Add("C");       ... Read More

Get a read-only copy of the OrderedDictionary in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:59:05

182 Views

To get a read-only copy of the OrderedDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       OrderedDictionary dict1 = new OrderedDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       ... Read More

Check if two Tuple Objects are equal in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:55:15

177 Views

To check if two Tuple objects are equal, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args){       var tuple1 = Tuple.Create(150, 400, 500, 700, 100, 1200, 1500);       var tuple2 = Tuple.Create(150, 400, 500, 700, 100, ... Read More

Check if two StringBuilder objects are Equal in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:51:17

165 Views

To check if two StringBuilder objects are equal, the code is as follows −Example Live Demousing System; using System.Text; public class Demo {    public static void Main(String[] args){       StringBuilder strBuilder1 = new StringBuilder("Tim");       StringBuilder strBuilder2 = new StringBuilder("Tom");       StringBuilder strBuilder3 = ... Read More

Check if two String objects have the same value in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:47:41

194 Views

To check if two String objects have the same value, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args){       string str1 = "John";       string str2 = "John";       Console.WriteLine("String 1 = "+str1);   ... Read More

Creating a read-only wrapper for the ArrayList in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 06:38:28

202 Views

To create a read-only wrapper for ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       ArrayList list = new ArrayList();       list.Add("One");       list.Add("Two");       list.Add("Three");       list.Add("Four"); ... Read More

Advertisements