AmitDiwan has Published 10740 Articles

Adding the elements of the specified collection to the end of the List in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:06:25

128 Views

To add elements of the specified collection to the end of 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 list = new List();       list.Add("Andy");       list.Add("Gary");   ... Read More

Adding new node or value at the start of LinkedList in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 10:03:58

187 Views

To add new node or value at the start of 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

Check if OrderedDictionary collection is read-only in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:59:05

125 Views

To check if OrderedDictionary collection 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(){       OrderedDictionary dict = new OrderedDictionary();       dict.Add("1", "One");       dict.Add("2", "Two");       dict.Add("3", ... Read More

Convert the value of the specified Decimal to the equivalent 16-bit unsigned integer in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:57:03

251 Views

To convert the value of the specified Decimal to the equivalent 16-bit unsigned integer, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       Decimal val = 875.647m;       Console.WriteLine("Decimal value = "+val);       ushort ... Read More

Check if OrderedDictionary collection contains a specific key in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:55:55

210 Views

To check if OrderedDictionary collection contains a specific key, the code is as follows −Example Live Demousing System; using System.Collections; using System.Collections.Specialized; public class Demo {    public static void Main(){       OrderedDictionary dict = new OrderedDictionary();       dict.Add("1", "One");       dict.Add("2", "Two");     ... Read More

Get the hash code for this instance in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:54:27

268 Views

To get the hash code for this instance, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       string[] arr = {"tom", "amit", "kevin", "katie"};       Type t1 = arr.GetType();       Type t2 = t1.GetElementType(); ... Read More

Adding an element into the Hashtable in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:53:02

344 Views

To add an element into 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

Get a specific field of the current type C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:51:35

472 Views

To get a specific field of the current type in C#, the code is as follows −Example Live Demousing System; using System.Reflection; public class Demo {    public static void Main() {    Type type = typeof(Subject);       try {          FieldInfo fieldInfo = type.GetField("SubName");   ... Read More

Add the specified key and value into the ListDictionary in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:49:45

167 Views

To add the specified key and value into the 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("1", "One");       dict.Add("2", "Two");   ... Read More

Get the array of the values of the constants in the current enum type in C#

AmitDiwan

AmitDiwan

Updated on 10-Dec-2019 09:48:24

148 Views

To get the array of the values of the constants in the current enumeration type, the code is as follows −Example Live Demousing System; public class Demo {    enum Vehicle {Car, Bus, Bike, Airplane}    public static void Main() {       try {          Type ... Read More

Advertisements