Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Server Side Programming Articles
Page 868 of 2109
UInt64.ToString() Method in C# with Examples
The UInt64.ToString() method in C# is used to convert the numeric value of the current UInt64 instance to its equivalent string representation. This method is particularly useful when you need to display UInt64 values as text or perform string operations on numeric data. Syntax Following is the syntax for the parameterless overload − public override string ToString(); The method also has additional overloads for custom formatting − public string ToString(string format); public string ToString(IFormatProvider provider); public string ToString(string format, IFormatProvider provider); Return Value Returns a string that represents the ...
Read MoreUri.CheckHostName(String) Method in C#
The Uri.CheckHostName() method in C# is used to determine the type of hostname specified in a string. It validates whether the given string represents a valid DNS name, IPv4 address, IPv6 address, or an unknown format. Syntax Following is the syntax − public static UriHostNameType CheckHostName(string hostName); Parameters hostName − A string that contains the hostname to validate. Return Value The method returns a UriHostNameType enumeration value that indicates the type of the hostname − UriHostNameType Description Dns Valid ...
Read MoreUri.CheckSchemeName(String) Method in C#
The Uri.CheckSchemeName() method in C# is used to determine whether the specified scheme name is valid. A valid scheme name must start with a letter and can contain only letters, digits, plus (+), period (.), or hyphen (-) characters. Syntax Following is the syntax − public static bool CheckSchemeName(string schemeName); Parameters schemeName − The scheme name to validate as a string. Return Value Returns true if the scheme name is valid; otherwise, false. Valid vs Invalid Scheme Names Valid ...
Read MoreUri.Equals(Object) Method in C#
The Uri.Equals(Object) method in C# compares two Uri instances for equality. This method performs a case-sensitive comparison of the complete URI strings, including scheme, host, port, path, query, and fragment components. Syntax Following is the syntax − public override bool Equals(object comparand); Parameters comparand − The Uri instance or object to compare with the current instance. Can be null. Return Value Returns true if the specified object is a Uri instance equivalent to the current Uri instance; otherwise, false. If the comparand is null or not a Uri object, the method ...
Read MoreInt64.CompareTo Method in C# with Examples
The Int64.CompareTo() method in C# is used to compare the current long instance with a specified object or Int64 value and returns an integer indicating their relative values. This method is essential for sorting operations and value comparisons. Syntax The Int64.CompareTo() method has two overloads − public int CompareTo(long value); public int CompareTo(object value); Parameters value − In the first overload, it's a long integer to compare. In the second overload, it's an object to compare, which must be null or an instance of Int64. Return Value The method ...
Read MoreDecimal.Multiply() Method in C#
The Decimal.Multiply() method in C# is used to multiply two specified decimal values and returns the result as a decimal. This method provides a safe way to perform decimal multiplication while maintaining precision and handling potential overflow conditions. Syntax Following is the syntax − public static decimal Multiply(decimal val1, decimal val2); Parameters val1 − The first decimal value (multiplicand). val2 − The second decimal value (multiplier). Return Value Returns a decimal value that represents the product of val1 and val2. Using Decimal.Multiply() for Basic ...
Read MoreDecimal.Negate() Method in C#
The Decimal.Negate() method in C# is used to return the result of multiplying the specified decimal value by negative one. This method effectively changes the sign of a decimal number − positive numbers become negative and negative numbers become positive. Syntax Following is the syntax − public static decimal Negate(decimal val); Parameters val − The decimal value to negate. Return Value Returns a decimal number that is equal to val multiplied by negative one (-1). If val is positive, the result is negative. If val is negative, the result ...
Read MoreDecimal.Remainder() Method in C#
The Decimal.Remainder() method in C# is used to calculate the remainder after dividing two Decimal values. This method performs the same operation as the modulus operator (%) but is specifically designed for decimal precision calculations. Syntax Following is the syntax − public static decimal Remainder(decimal val1, decimal val2); Parameters val1 − The dividend (the number to be divided). val2 − The divisor (the number by which to divide). Return Value Returns a decimal value representing the remainder after dividing val1 by val2. Division Operation: ...
Read MoreDecimal.Round() Method in C#
The Decimal.Round() method in C# is used to round a decimal value to the nearest integer or to a specified number of decimal places. This method provides several overloads to handle different rounding scenarios and precision requirements. Syntax The Decimal.Round() method has four main overloads − public static decimal Round(decimal d); public static decimal Round(decimal d, int decimals); public static decimal Round(decimal d, MidpointRounding mode); public static decimal Round(decimal d, int decimals, MidpointRounding mode); Parameters d − The decimal number to be rounded. decimals − The number of decimal ...
Read MoreDecimal.Subtract() Method in C#
The Decimal.Subtract() method in C# is used to subtract two specified decimal values and returns the result. This static method provides a way to perform decimal subtraction with high precision, making it ideal for financial and monetary calculations. Syntax Following is the syntax − public static decimal Subtract(decimal val1, decimal val2); Parameters val1 − The minuend (the number from which another number is to be subtracted). val2 − The subtrahend (the number that is to be subtracted). Return Value Returns a decimal value that represents ...
Read More