AmitDiwan has Published 10744 Articles

Check if two StringDictionary objects are equal or not in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:53:23

156 Views

To check if two StringDictionary objects are equal or not, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringDictionary strDict1 = new StringDictionary();       strDict1.Add("A", "John");       strDict1.Add("B", "Andy");     ... Read More

Check if two StringCollection objects are equal in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:48:15

158 Views

To check if two StringCollection objects are equal, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection strCol1 = new StringCollection();       strCol1.Add("Accessories");       strCol1.Add("Books");       strCol1.Add("Electronics");     ... Read More

Get or set the value associated with specified key in ListDictionary in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:42:04

124 Views

To get or set the value associated with specified key in ListDictionary, 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("A", "Books");       ... Read More

Remove elements from a SortedSet that match the predicate in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:38:23

310 Views

To remove elements from a SortedSet that match the predicate, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    private static bool demo(int i) {       return ((i % 10) == 0);    }    public static void Main(String[] args) {   ... Read More

Remove elements from a HashSet with conditions defined by the predicate in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:34:20

308 Views

To remove elements from a HashSet with conditions defined by the predicate, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    private static bool demo(int i) {       return (i == 100);    }    public static void Main(String[] args) {   ... Read More

Remove element at specified index of Collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:26:35

175 Views

To remove element at specified index of 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("Andy");       col.Add("Kevin");       col.Add("John");     ... Read More

How to get Second Element of the Tuple in C#?

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 10:07:08

311 Views

To get second element of the Tuple, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(String[] args) {       var tuple1 = Tuple.Create(75, 200, 500, 700, 100, 1200, 1500);       var tuple2 = Tuple.Create(75, 200, 500, 700, 100, ... Read More

C# Check if HybridDictionary is read only

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 09:58:15

91 Views

To check if HybridDictionary 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() {       HybridDictionary dict1 = new HybridDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");       ... Read More

Get an ICollection containing the keys in HybridDictionary in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 08:09:38

97 Views

To get an ICollection containing the keys in HybridDictionary, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main(){       HybridDictionary dict = new HybridDictionary();       dict.Add("One", "Katie");       dict.Add("Two", "Andy");       dict.Add("Three", ... Read More

Get an enumerator that iterates through the SortedDictionary in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 08:06:48

139 Views

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

Advertisements