AmitDiwan has Published 10740 Articles

Capacity of a SortedList in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:27:26

184 Views

To get the capacity of 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");       sortedList.Add("C", "3"); ... Read More

Check whether the Unicode character is a separator character in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:24:15

279 Views

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

Convert Decimal to equivalent 8-bit unsigned integer in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:21:28

323 Views

To convert the value of the specified Decimal to the equivalent 8-bit unsigned integer, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(){       Decimal val1 = 6.59m;       Decimal val2 = 30.12m;       Decimal val3 ... Read More

Get the TypeCode for value type Decimal in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:15:28

192 Views

To get the TypeCode for value type Decimal, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(){       Decimal val = Decimal.MaxValue;       Console.WriteLine("Decimal Value = {0}", val);       Console.WriteLine("HashCode = {0}", (val.GetHashCode()) );     ... Read More

Get the hash code for the current Decimal instance in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:11:04

174 Views

To get the hash code for the current Decimal instance, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(){       Decimal val = 135269.38193M;       Console.WriteLine("Decimal Value = {0}", val);       Console.WriteLine("HashCode = {0}", (val.GetHashCode()) ); ... Read More

Convert the specified string representation of a logical value to its Boolean equivalent in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:08:28

138 Views

To convert the specified string representation of a logical value to its Boolean equivalent, the code is as follows −Example Live Demousing System; public class Demo {    public static void Main(){       bool val;       bool flag;       val = Boolean.TryParse("true", out flag);   ... Read More

Convert the value of the current DateTime object to UTC in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 06:03:43

2K+ Views

To convert the value of the current DateTime object to Coordinated Universal Time (UTC), the code is as follows −Example Live Demousing System; public class Demo {    public static void Main() {       DateTime d = new DateTime(2019, 12, 11, 7, 11, 25);       Console.WriteLine("Date = ... Read More

Capacity of a List in C#

AmitDiwan

AmitDiwan

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

354 Views

To get the capacity of a 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

Union of two HashSet in C#

AmitDiwan

AmitDiwan

Updated on 09-Dec-2019 05:29:16

295 Views

Let us see an example to get the Union of two HashSetExample Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main(){       HashSet set1 = new HashSet();       set1.Add(100);       set1.Add(200);       set1.Add(300);       set1.Add(400);   ... Read More

Check if HashSet and the specified collection contain the same elements in C#

AmitDiwan

AmitDiwan

Updated on 06-Dec-2019 12:42:14

175 Views

To check if HashSet and the specified collection contain the same elements, 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("One");       set1.Add("Two");     ... Read More

Advertisements