AmitDiwan has Published 10744 Articles

Count the number of key/value pairs in HybridDictionary in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:58:43

104 Views

To count the number of key/value pairs in HybridDictionary, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict1 = new HybridDictionary();       dict1.Add("A", "SUV");       dict1.Add("B", "MUV");     ... Read More

Copying the SortedList elements to an Array Object in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:29:25

238 Views

To copy the SortedList elements to an Array Object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args){       SortedList list = new SortedList();       list.Add("1", "AB");       list.Add("2", "CD");       ... Read More

Copying the HybridDictionary entries to an Array Instance in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:26:47

126 Views

To copy the HybridDictionary entries to an Array Instance, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict = new HybridDictionary();       dict.Add("1", "SUV");       dict.Add("2", "AUV");     ... Read More

Copying the Hashtable elements to an Array Instance in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:23:32

221 Views

To copy the Hashtable elements to an Array Instance, 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", "AB");       hash.Add("2", "CD");       hash.Add("3", "EF"); ... Read More

How to get a subset in a SortedSet in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:21:06

150 Views

To get a subset in a SortedSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       SortedSet set1 = new SortedSet();       set1.Add("AB");       set1.Add("BC");       set1.Add("CD");       set1.Add("EF"); ... Read More

How to create a Stack in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:17:37

128 Views

To create a Stack, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Stack stack = new Stack();       stack.Push(100);       stack.Push(150);       stack.Push(175);       stack.Push(200);       ... Read More

Copying the entire ArrayList to 1-D Array starting at the specified index in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:14:33

89 Views

To copy the entire ArrayList to a 1-D array starting at the specified index, 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("PQ");       list.Add("RS");   ... Read More

Copying the elements of ArrayList to a new array in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:08:53

140 Views

To copy the elements of ArrayList to a new array, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       ArrayList list = new ArrayList(10);       list.Add("A");       list.Add("B");       list.Add("C");   ... Read More

How to create a SortedList in C#?

AmitDiwan

AmitDiwan

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

121 Views

To create 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

How to create a shallow copy of the BitArray in C#?

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 11:00:20

142 Views

To create a shallow copy of the BitArray, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       BitArray arr1 = new BitArray(5);       arr1[0] = false;       arr1[1] = true;       ... Read More

Advertisements