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

AmitDiwan
Published on 06-Dec-2019 07:21:25
To get the first 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

Check if two ListDictionary objects are equal in C#

AmitDiwan
Published on 06-Dec-2019 07:11:51
To check if two ListDictionary objects are equal, 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

Check if two List objects are equal in C#

AmitDiwan
Published on 06-Dec-2019 07:08:31
To check if two List objects are equal, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(String[] args){       List<string> list1 = new List<string>();       list1.Add("One");       list1.Add("Two");       list1.Add("Three");     ... Read More

Remove the element with the specified key from the Hashtable in C#

AmitDiwan
Published on 06-Dec-2019 07:05:40
To remove the element with the specified key from the Hashtable, 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");     ... Read More

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

AmitDiwan
Published on 06-Dec-2019 07:02:34
To get the fifth 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

Getting an enumerator that iterates through LinkedList in C#

AmitDiwan
Published on 06-Dec-2019 06:58:42
To get an enumerator that iterates through LinkedList, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       LinkedList<string> list = new LinkedList<string>();       list.AddLast("A");       list.AddLast("B");       list.AddLast("C");       ... Read More

Get the number of elements in the SortedSet in C#

AmitDiwan
Published on 06-Dec-2019 06:54:24
To get the number of elements in the SortedSet, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       SortedSet<string> set1 = new SortedSet<string>();       set1.Add("AB");       set1.Add("BC");       set1.Add("CD");     ... Read More

Get the number of elements contained in the Stack in C#

AmitDiwan
Published on 06-Dec-2019 06:51:33
To get the number of elements contained in the Stack, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Stack<string> stack = new Stack<string>();       stack.Push("A");       stack.Push("B");       stack.Push("C");   ... Read More

Add an object to the end of the Queue - Enqueue Operation in C#

AmitDiwan
Published on 06-Dec-2019 06:48:56
To add an object to the end of the Queue, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Queue<string> queue = new Queue<string>();       queue.Enqueue("Electronics");       queue.Enqueue("Accessories");       queue.Enqueue("Toys");   ... Read More

Convert Stack to array in C#

AmitDiwan
Published on 06-Dec-2019 06:45:52
To convert stack to the array, the code is as follows −Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       Stack<string> stack = new Stack<string>();       stack.Push("AB");       stack.Push("CD");       stack.Push("FG");       stack.Push("KL");   ... Read More
Advertisements