AmitDiwan has Published 10744 Articles

Check if two OrderedDictionary objects are equal in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:34:02

114 Views

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

Remove the element with the specified key from a SortedList in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:29:52

259 Views

To remove the element with the specified key from 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"); ... Read More

Remove the element at the specified index of the ArrayList in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:26:06

155 Views

To remove the element at the specified index of the ArrayList, the code is as follows −Example Live Demousing System; using System.Collections; public class Demo {    public static void Main(String[] args) {       ArrayList list1 = new ArrayList();       list1.Add("A");       list1.Add("B");     ... Read More

Get the number of strings in StringCollection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:18:59

83 Views

To get the number of strings in StringCollection, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringCollection strCol = new StringCollection();       String[] strArr = new String[] { "A", "B", "C", "D", "E", ... Read More

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

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:14:47

97 Views

To get or set the value associated with specified key in StringDictionary, the code is as follows −Example Live Demousing System; using System.Collections.Specialized; public class Demo {    public static void Main() {       StringDictionary strDict = new StringDictionary ();       strDict.Add("A", "Books");       strDict.Add("B", ... Read More

Remove from the specified index of the StringCollection in C#

AmitDiwan

AmitDiwan

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

139 Views

To remove from the specified index of the 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", ... Read More

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

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:06:35

107 Views

To get seventh 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

Remove all elements from the Hashtable in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 12:03:24

206 Views

To remove all elements 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");       hash.Add("3", "C"); ... Read More

Remove all elements from the Collection in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 11:58:52

425 Views

To remove all elements from 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 whether the specified Unicode character is a punctuation mark in C#

AmitDiwan

AmitDiwan

Updated on 05-Dec-2019 11:53:57

273 Views

To check whether the specified Unicode character is a punctuation mark, the code is as follow −Example Live Demousing System; public class Demo {    public static void Main() {       bool res;       char val = 'q';       Console.WriteLine("Value = "+val);       ... Read More

Advertisements