AmitDiwan has Published 10740 Articles

TimeSpan.FromHours() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 06:51:14

1K+ Views

The TimeSpan.FromHours() method in C# is used to return a TimeSpan that represents a specified number of hours, where the specification is accurate to the nearest millisecond.SyntaxThe syntax is as follows −public static TimeSpan FromHours (double val);Above, the value val is a number of hours accurate to the nearest millisecond.ExampleLet ... Read More

Stack.GetEnumerator() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 06:47:25

134 Views

The Stack.GetEnumerator() method in C# is used to return an IEnumerator for the Stack.SyntaxThe syntax is as follows −public virtual System.Collections.IEnumerator GetEnumerator ();ExampleLet us now see an example − Live Demousing System; using System.Collections; public class Demo {    public static void Main(){       Stack stack1 = new Stack(); ... Read More

Stack.Equals() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 06:44:07

347 Views

The Stack.Equals() method in C# is used to check whether a Stack class object is equal to another object or not.SyntaxThe syntax is as follows −public virtual bool Equals (object ob);Above, the parameter ob is the object compared with another.ExampleLet us now see an example − Live Demousing System; using System.Collections; ... Read More

Double.IsNaN() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 06:39:35

728 Views

The Double.IsNaN() method in C# is used to return a value that indicates whether the specified value is not a number (NaN).SyntaxThe syntax is as follows −public static bool IsNaN (double val);Above, val is the double-precision floating-point number.ExampleLet us now see an example − Live Demousing System; public class Demo { ... Read More

TimeSpan.FromDays() Method in C#

AmitDiwan

AmitDiwan

Updated on 03-Dec-2019 06:36:56

722 Views

The TimeSpan.FromDays() method in C# is used to return a TimeSpan that represents a specified number of days, where the specification is accurate to the nearest millisecond.SyntaxThe syntax is as follows −public static TimeSpan FromDays (double val);Above, the parameter val is the number of days, accurate to the nearest millisecond.ExampleLet ... Read More

C# BitConverter.ToUInt64 Method

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:41:46

307 Views

The BitConverter.ToUInt64() method in C# is used to return a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array.Syntaxpublic static ulong ToUInt64 (byte[] val, int begnIndex);ExampleAbove, val is the byte array, whereas begnIndex is the beginning position within val. Live Demousing System; public class Demo ... Read More

C# BitConverter.ToUInt32() Method

AmitDiwan

AmitDiwan

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

396 Views

The BitConverter.ToUInt32() method in C# is used to return a 32-bit unsigned integer converted from four bytes at a specified position in a byte array.Syntaxpublic static uint ToUInt32 (byte[] val, int begnIndex);Above, val is the byte array, whereas begnIndex is the starting position withing val.Example Live Demousing System; public class Demo ... Read More

C# String Operators

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:31:22

602 Views

There are two string operators in C#: Equality and Inequality.ExampleLet us see an example of Equality operator − Live Demousing System; public class Demo {    public static void Main() {       string str1 = "Amit";       string str2 = " ";       Console.WriteLine("Is string1 ... Read More

C# Queue.TrimExcess() Method with Examples

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:28:15

330 Views

The Queue.TrimExcess() method in C# is used to set the capacity to the actual number of elements in the Queue, if that number is less than 90 percent of current capacity.Syntaxpublic void TrimExcess ();Example Live Demousing System; using System.Collections.Generic; public class Demo {    public static void Main() {     ... Read More

C# BitConverter.ToString(Byte[]) Method

AmitDiwan

AmitDiwan

Updated on 02-Dec-2019 12:16:46

2K+ Views

The BitConverter.ToString() method in C# is used to convert the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation.Syntaxpublic static string ToString (byte[] val);Above, val is the byte array.Example Live Demousing System; public class Demo {    public static void Main() {   ... Read More

Advertisements