AmitDiwan has Published 10744 Articles

Array.LastIndexOf(T[], T) Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 06:14:01

200 Views

The Array.LastIndexOf() method in C# is used to search for the specified object and returns the index of the last occurrence within the entire Array.SyntaxFollowing is the syntax −public static int LastIndexOf (T[] array, T val);Above, the parameter arr is the one-dimensional, zero-based Array to search, whereas Val is the ... Read More

Array.GetEnumerator Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 06:10:28

234 Views

The Array.GetEnumerator() method in C# is used to return an IEnumerator for the Array.SyntaxFollowing is the syntax −public virtual System.Collections.IEnumerator GetEnumerator ();ExampleLet us now see an example to implement the Array.GetEnumerator() method −using System; using System.Collections; public class Demo{    public static void Main(){       int j = ... Read More

Array.FindLast() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 06:07:48

507 Views

The Array.FindLast() method in C# is used to search for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire Array.SyntaxFollowing is the syntax −public static T FindLast (T[] array, Predicate match);Above, array is the one-dimensional, zero-based Array to search, whereas ... Read More

DateTime.ToFileTime() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 06:05:52

498 Views

The DateTime.ToFileTime() method in C# is used to convert the value of the current DateTime object to a Windows file time.SyntaxFollowing is the syntax −public long ToFileTime ();ExampleLet us now see an example to implement the DateTime.ToFileTime() method −using System; public class Demo {    public static void Main() { ... Read More

DateTime.ToBinary() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 06:03:15

701 Views

The DateTime.ToBinary() method in C# is used to serialize the current DateTime object to a 64-bit binary value that can be used to recreate the DateTime object. The return value is a 64-bit signed integer.SyntaxFollowing is the syntax −public long ToBinary ();ExampleLet us now see an example to implement the ... Read More

DateTime.Subtract() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 06:01:23

1K+ Views

The DateTime.Subtract() method in C# is used to subtract the specified DateTime or span.SyntaxFollowing is the syntax −public TimeSpan Subtract (DateTime value); public DateTime Subtract (TimeSpan value);ExampleLet us now see an example to implement the DateTime.Subtract() method −using System; public class Demo {    public static void Main() {   ... Read More

How to create 2-tuple or pair tuple in C#?

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 05:58:40

297 Views

The Tuple class represents a 2-tuple, which is called pair. A tuple is a data structure that has a sequence of elements.ExampleLet us now see an example to implement the 2-tuple in C# −using System; public class Demo {    public static void Main(string[] args) {       Tuple ... Read More

DateTimeOffset.CompareTo() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 05:52:43

113 Views

The DateTimeOffset.CompareTo() method in C# is used to compares the current DateTimeOffset object to a specified DateTimeOffset object and indicates whether the current object is earlier than, the same as, or later than the second DateTimeOffset object.It returns an integer value, 0 − If this object is later than ValSyntaxFollowing ... Read More

DateTime.SpecifyKind() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 05:50:12

5K+ Views

The DateTime.SpecifyKind() method in C# is used to create a new DateTime object that has the same number of ticks as the specified DateTime but is designated as either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified DateTimeKind value.SyntaxFollowing is the syntax −public static DateTime ... Read More

Decimal.ToUInt16() Method in C#

AmitDiwan

AmitDiwan

Updated on 07-Nov-2019 05:48:06

52 Views

The Decimal.ToUInt16() method in C# is used to convert the value of the specified Decimal to the equivalent 16-bit unsigned integer.SyntaxFollowing is the syntax −public static ushort ToUInt16 (decimal val);Above, the value val is the decimal number to convert.ExampleLet us now see an example to implement the Decimal.ToUInt16() method −using ... Read More

Advertisements