Server Side Programming Articles

Page 864 of 2109

Type.GetTypeArray() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 134 Views

The Type.GetTypeArray() method in C# is used to retrieve the Type objects representing the runtime types of all elements in a specified object array. This method is particularly useful in reflection scenarios where you need to determine the actual types of objects at runtime. Syntax Following is the syntax − public static Type[] GetTypeArray (object[] args); Parameters args − An array of objects whose types are to be determined. Return Value This method returns an array of Type objects representing the types of the corresponding elements in ...

Read More

Type.GetTypeCode() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 280 Views

The Type.GetTypeCode() method in C# is used to get the underlying type code of the specified Type. It returns a TypeCode enumeration value that represents the type classification of the given Type object. Syntax Following is the syntax − public static TypeCode GetTypeCode(Type type); Parameters type − The Type object whose underlying type code is to be retrieved. Return Value Returns a TypeCode enumeration value that represents the type category. If the type is null, it returns TypeCode.Empty. Using GetTypeCode() with Built-in Types Example ...

Read More

Int32. Equals Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 306 Views

The Int32.Equals() method in C# is used to compare the current integer instance with another value to determine if they are equal. It returns a boolean value indicating whether the comparison values are equal or not. Syntax The Int32.Equals() method has two overloaded forms − public bool Equals(int other); public override bool Equals(object obj); Parameters other − An Int32 value to compare with the current instance. obj − An object to compare with the current instance. Return Value Both overloads return a bool value − true if ...

Read More

DateTime.ToShortTimeString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 1K+ Views

The DateTime.ToShortTimeString() method in C# converts a DateTime object to its equivalent short time string representation. This method formats the time portion of the date using the current system culture's short time pattern, typically showing hours and minutes in 12-hour or 24-hour format. Syntax Following is the syntax − public string ToShortTimeString(); Return Value Returns a string that contains the short time string representation of the current DateTime object. Using ToShortTimeString() with Current DateTime This example demonstrates how to use ToShortTimeString() with the current system time and shows the culture-specific formatting ...

Read More

DateTime.ToString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 565 Views

The DateTime.ToString() method in C# converts a DateTime object to its string representation. This method provides multiple overloads to format the date and time according to different requirements using format strings and culture-specific formatting. Syntax The DateTime.ToString() method has four overloads − ToString() ToString(String) ToString(IFormatProvider) ToString(String, IFormatProvider) Parameters format − A standard or custom date and time format string. provider − An object that supplies culture-specific formatting information. Return Value Returns a string representation of the current DateTime object formatted according to the specified format string and culture information. ...

Read More

DateTime.ToUniversalTime() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 1K+ Views

The DateTime.ToUniversalTime() method in C# is used to convert the value of the current DateTime object to Coordinated Universal Time (UTC). This method is essential when working with applications that handle multiple time zones or need to store timestamps in a universal format. Syntax Following is the syntax − public DateTime ToUniversalTime(); Return Value Returns a DateTime object whose value is equivalent to the current DateTime object converted to UTC. If the current DateTime object represents a local time, it is converted to UTC using the system's time zone information. If it already ...

Read More

Boolean.TryParse() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 2K+ Views

The Boolean.TryParse() method in C# safely converts a string representation of a logical value to its Boolean equivalent. Unlike Boolean.Parse(), this method returns true if the conversion succeeds and false if it fails, without throwing exceptions. Syntax Following is the syntax − public static bool TryParse(string value, out bool result); Parameters value − A string containing the value to convert. result − When this method returns, contains the Boolean value equivalent to the value contained in value, if the conversion succeeded, or false if the conversion failed. ...

Read More

Byte.CompareTo(Byte) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 203 Views

The Byte.CompareTo(Byte) method in C# is used to compare the current byte instance to a specified 8-bit unsigned integer and returns an indication of their relative values. This method is useful for sorting operations and determining the relative ordering of byte values. Syntax Following is the syntax − public int CompareTo(byte value); Parameters value: An 8-bit unsigned integer to compare with the current instance. Return Value The method returns an integer that indicates the relative values of the compared instances: Less than zero: The current instance is less ...

Read More

Byte.CompareTo(Object) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 156 Views

The Byte.CompareTo(Object) method in C# compares the current byte instance to a specified object and returns an integer that indicates their relative values. This method is useful for sorting operations and determining the ordering relationship between byte values. Syntax Following is the syntax − public int CompareTo(object val); Parameters val − An object to compare, or null. Return Value The method returns an integer with the following meaning − Less than zero − The current instance is less than the value. Zero − The current instance ...

Read More

DateTimeOffset.AddMinutes() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 461 Views

The DateTimeOffset.AddMinutes() method in C# adds a specified number of whole and fractional minutes to a DateTimeOffset instance. This method returns a new DateTimeOffset object with the updated time while preserving the original offset from UTC. The method is particularly useful when working with time-zone aware calculations, as it maintains the timezone offset information throughout the operation. Syntax Following is the syntax − public DateTimeOffset AddMinutes(double minutes); Parameters minutes − A double value representing the number of minutes to add. Can be positive (to add) or negative (to subtract). Fractional values ...

Read More
Showing 8631–8640 of 21,090 articles
« Prev 1 862 863 864 865 866 2109 Next »
Advertisements