AmitDiwan has Published 10740 Articles

Get the number of key/value pairs contained in ListDictionary in C#

AmitDiwan

AmitDiwan

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

154 Views

To get the number of key/value pairs contained 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 dict1 = new ListDictionary();       dict1.Add("A", "Books");       dict1.Add("B", "Electronics");     ... Read More

Removing first occurrence of specified value from LinkedList in C#

AmitDiwan

AmitDiwan

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

318 Views

To remove the first occurrence of specified value from LinkedList, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       LinkedList list = new LinkedList();       list.AddLast("A");       list.AddLast("B");       list.AddLast("C");   ... Read More

Removing first occurrence of object from Collection in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 05:32:14

147 Views

To remove the first occurrence of the object from 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

Remove a range of elements from the List in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 05:27:45

493 Views

To remove a range of elements from the List, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       List list1 = new List();       list1.Add("One");       list1.Add("Two");       list1.Add("Three");   ... Read More

Remove the specified element from a HashSet in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 05:23:44

451 Views

To remove the specified element from a HashSet, 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("AB");       set1.Add("CD");       set1.Add("EF");       ... Read More

Add key and value into OrderedDictionary collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 13:24:33

219 Views

To add key and value into OrderedDictionary collection, 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

Add element to SortedSet in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 13:20:35

202 Views

To add element to 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(100);       set1.Add(200);       set1.Add(300);       set1.Add(400);   ... Read More

Getting the key at the specified index of a SortedList object in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 13:18:55

130 Views

To get the key at the specified index of a SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       SortedList list1 = new SortedList();       list1.Add("One", 1);       list1.Add("Two ... Read More

Getting the index of the specified key in a SortedList object in C#

AmitDiwan

AmitDiwan

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

313 Views

To get index of the specified key in a SortedList 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("One", "Finance");       list.Add("Two", "Marketing"); ... Read More

Getting index of the specified value in a SortedList object in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 13:09:37

117 Views

To get index of the specified value in a SortedList object, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       SortedList list1 = new SortedList();       list1.Add("One", 1);       list1.Add("Two ", ... Read More

Advertisements