Server Side Programming Articles

Page 854 of 2109

How to create 3-Tuple or Triple Tuple in C#?

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 499 Views

The Tuple class represents a 3-tuple, also called a triple. A tuple is a data structure that contains a sequence of elements of different types, providing a convenient way to group related data together without creating a custom class. 3-tuples are commonly used for − Easier access to a data set with three related values. Easier manipulation of grouped data. To represent a single set of three related values. To return multiple values from a method. To pass multiple values to a method as a single parameter. ...

Read More

How to create 4-Tuple or quadruple in C#?

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 290 Views

The Tuple class represents a 4-tuple, which is called a quadruple. A tuple is a data structure that holds a sequence of elements of different types in a single object. 4-tuples are commonly used for − Easier access to a data set. Easier manipulation of a data set. To represent a single set of data. To return multiple values from a method. To pass multiple values to a method. 4-Tuple Structure Item1 Item2 Item3 ...

Read More

Math.Max() Method in C#

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

The Math.Max() method in C# returns the larger of two specified numbers. This static method is overloaded to work with various numeric types including int, double, decimal, float, and more. Syntax The Math.Max() method has multiple overloads for different numeric types − public static int Max(int val1, int val2); public static double Max(double val1, double val2); public static decimal Max(decimal val1, decimal val2); public static float Max(float val1, float val2); public static long Max(long val1, long val2); public static byte Max(byte val1, byte val2); public static short Max(short val1, short val2); public static uint Max(uint val1, ...

Read More

Convert.ToByte(String, IFormatProvider) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 606 Views

The Convert.ToByte(String, IFormatProvider) method in C# converts the specified string representation of a number to an equivalent 8-bit unsigned integer, using specified culture-specific formatting information. This method is particularly useful when working with string data from different cultures that may use different number formats, such as different decimal separators or thousand separators. Syntax Following is the syntax − public static byte ToByte(string value, IFormatProvider provider); Parameters value − A string that contains the number to convert. The value must be between 0 and 255. provider − An object ...

Read More

Char.ConvertFromUtf32(Int32) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 494 Views

The Char.ConvertFromUtf32(Int32) method in C# converts a specified Unicode code point into a UTF-16 encoded string. This method is particularly useful when working with Unicode characters that may be represented as numeric code points and need to be converted to their corresponding string representation. Syntax Following is the syntax − public static string ConvertFromUtf32(int utf32); Parameters utf32: A 21-bit Unicode code point representing a valid Unicode character. The valid range is from 0x000000 to 0x10FFFF, excluding the surrogate pair range (0xD800 to 0xDFFF). Return Value Returns a string object consisting of ...

Read More

Math.Min() Method in C#

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

The Math.Min() method in C# is used to return the smaller of two specified numbers. This method is overloaded to work with various numeric data types including byte, decimal, double, float, int, long, sbyte, short, uint, ulong, and ushort. Syntax Following are the most commonly used overloads − public static int Min(int val1, int val2); public static double Min(double val1, double val2); public static decimal Min(decimal val1, decimal val2); public static float Min(float val1, float val2); public static long Min(long val1, long val2); public static byte Min(byte val1, byte val2); public static short Min(short val1, short ...

Read More

Math.Pow() Method in C#

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

The Math.Pow() method in C# is used to compute a number raised to the power of another number. It returns the result as a double value and can handle both positive and negative bases and exponents. Syntax Following is the syntax − public static double Pow(double val1, double val2) Parameters val1 − A double-precision floating-point number to be raised to a power (the base). val2 − A double-precision floating-point number that specifies the power (the exponent). Return Value Returns a double representing val1 raised to ...

Read More

DateTime.AddYears() Method in C#

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

The DateTime.AddYears() method in C# adds a specified number of years to a DateTime instance and returns a new DateTime object. This method is particularly useful for calculating future or past dates, handling anniversaries, or working with year-based intervals. Syntax Following is the syntax for the AddYears() method − public DateTime AddYears(int value); Parameters The method accepts a single parameter − value − An integer representing the number of years to add. Use positive values to add years and negative values to subtract years. Return Value Returns a ...

Read More

Math.Sqrt() Method in C#

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

The Math.Sqrt() method in C# is used to compute the square root of a specified number. This static method is part of the System.Math class and returns a double value representing the positive square root of the input. Syntax Following is the syntax − public static double Sqrt(double val); Parameters val − A double-precision floating-point number for which to calculate the square root. Must be greater than or equal to zero for a valid numeric result. Return Value The method returns a double value with the following behavior − ...

Read More

Type.GetElementType() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 274 Views

The Type.GetElementType() method in C# is used to return the Type of the object encompassed or referred to by the current array, pointer, or reference type. This method is particularly useful when working with collection types to discover what type of elements they contain. Syntax Following is the syntax − public abstract Type GetElementType(); Return Value Returns a Type object representing the element type of the current array, pointer, or reference type. If the current Type is not an array, pointer, or reference type, the method returns null. Using GetElementType() with Arrays ...

Read More
Showing 8531–8540 of 21,090 articles
« Prev 1 852 853 854 855 856 2109 Next »
Advertisements