AmitDiwan has Published 10744 Articles

Check if the Hashtable contains a specific value in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:59:53

234 Views

To check if the Hashtable contains a specific value, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       Hashtable hash = new Hashtable();       hash.Add("1", "A");       hash.Add("2", "B");       hash.Add("3", ... Read More

Check if Hashtable has a fixed size in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:54:47

160 Views

To check if Hashtable has a fixed size, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       Hashtable hash = new Hashtable(10);       hash.Add("1", "A");       hash.Add("2", "B");       hash.Add("3", "C"); ... Read More

Check if an element is in the Queue in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:43:34

203 Views

To check if an element is in the Queue, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Queue queue = new Queue();       queue.Enqueue("Electronics");       queue.Enqueue("Accessories");       queue.Enqueue("Toys");     ... Read More

Check if an element is in the Collection in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:39:03

223 Views

To check if an element is in the Collection, the code is as follows −Example Live Demousing System; using System.Collections.ObjectModel; public class Demo {    public static void Main(){       Collection col = new Collection();       col.Add(10);       col.Add(20);       col.Add(30);     ... Read More

Check if an array object is equal to another array object in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:35:35

283 Views

To check if an array object is equal to another array object, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(){       String[] strArr1 = new String[3] { "John", "Jacob", "Tim"};       String[] strArr2 = new String[3] { ... Read More

Check if a HashSet is a proper subset of the specified collection in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:31:17

143 Views

To check if a HashSet is a proper subset of the specified collection, try the following code −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       HashSet set1 = new HashSet();       set1.Add(70);       set1.Add(100);       ... Read More

Check if a HashSet contains the specified element in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:20:37

749 Views

To check if a HashSet contains the specified element, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       HashSet set1 = new HashSet();       set1.Add(25);       set1.Add(50);       set1.Add(75);     ... Read More

Check if an array is read-only or not in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:17:11

217 Views

To check if an array is read-only or not, try the below code −Example Live Demousing System; public class Demo {    public static void Main(){       string[] products = new string[] { };       Console.WriteLine("One or more planets begin with 'E'? = {0}",       ... Read More

Get an enumerator that iterates through the Dictionary in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:06:52

531 Views

To get an enumerator that iterates through the Dictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Generic; public class Demo {    public static void Main(){       Dictionary dict = new Dictionary();       dict.Add(100, "Laptop");       dict.Add(150, "Desktop");     ... Read More

Get an enumerator that iterates through StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 04-Dec-2019 06:02:56

157 Views

To get an enumerator that iterates through StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main(){       StringCollection stringCol = new StringCollection();       String[] arr = new String[] { "100", "200", "300", "400", "500" }; ... Read More

Advertisements