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
Articles by AmitDiwan
Page 216 of 840
DateTime.CompareTo() Method in C#
The DateTime.CompareTo() method in C# is used to compare the value of this instance to a specified DateTime value. It returns an integer indicating the chronological relationship between two DateTime objects. Syntax Following is the syntax − public int CompareTo(DateTime value); Parameters value − The DateTime object to compare with the current instance. Return Value It returns an integer value − < 0 − If this instance is earlier than the specified value 0 − If this instance is the same as the specified value > 0 − If ...
Read MoreMathF.Atanh() Method in C# with Examples
The MathF.Atanh() method in C# returns the hyperbolic arc-tangent of a single-precision floating-point value. The hyperbolic arc-tangent is the inverse of the hyperbolic tangent function and is defined only for values in the range (-1, 1). For values outside this range, the method returns NaN (Not a Number). The method is useful in mathematical calculations involving hyperbolic functions and inverse transformations. Syntax Following is the syntax − public static float Atanh(float val); Parameters val − A single-precision floating-point number representing the hyperbolic tangent whose inverse is to be found. Must ...
Read MoreChar.IsLetterOrDigit() Method in C#
The Char.IsLetterOrDigit() method in C# determines whether a specified Unicode character is categorized as a letter or a decimal digit. This method is useful for validating input characters, parsing strings, and filtering alphanumeric content. Syntax Following is the syntax for the Char.IsLetterOrDigit() method − public static bool IsLetterOrDigit(char ch); There is also an overloaded version that works with strings − public static bool IsLetterOrDigit(string s, int index); Parameters ch − The Unicode character to evaluate. s − A string. index − The position of the character to evaluate ...
Read MoreChar.IsLower() Method in C#
The Char.IsLower() method in C# is used to determine whether a specified Unicode character is categorized as a lowercase letter. This method is part of the System.Char class and provides a convenient way to validate character case in string processing operations. Syntax Following is the syntax for the Char.IsLower() method − public static bool IsLower(char ch); Parameters ch − The Unicode character to evaluate. Return Value Returns true if the character is a lowercase letter; otherwise, false. Using Char.IsLower() with Uppercase Characters The following example ...
Read MoreDateTime.Equals() Method in C#
The DateTime.Equals() method in C# is used to check whether two DateTime objects or instances are equal or not. It returns true if both are equal, otherwise false. This method performs a tick-by-tick comparison, meaning it compares the exact moment in time down to the smallest unit (100-nanosecond intervals). Two DateTime objects are considered equal only if they represent the exact same point in time. Syntax Following is the syntax for the static DateTime.Equals() method − public static bool Equals(DateTime date1, DateTime date2); Parameters date1 − The first DateTime object ...
Read MoreDecimal.ToInt32() Method in C#
The Decimal.ToInt32() method in C# is used to convert the value of the specified Decimal to the equivalent 32-bit signed integer. This method performs truncation, meaning it removes the fractional part without rounding. Syntax Following is the syntax − public static int ToInt32(decimal val); Parameters val − The decimal number to convert to a 32-bit signed integer. Return Value Returns an int value that represents the truncated decimal value. If the decimal has fractional digits, they are discarded (not rounded). How It Works The method truncates the decimal value ...
Read MoreDateTime.FromBinary() Method in C#
The DateTime.FromBinary() method in C# is used to deserialize a 64-bit binary value and recreate an original serialized DateTime object. This method is particularly useful when you need to restore a DateTime object that was previously converted to its binary representation using ToBinary(). Syntax Following is the syntax − public static DateTime FromBinary(long dateData); Parameters dateData: A 64-bit signed integer that encodes the Kind property in a 2-bit field and the Ticks property in a 62-bit field. Return Value This method returns a DateTime object that is equivalent to the DateTime ...
Read MoreDecimal.ToInt64() Method in C#
The Decimal.ToInt64() method in C# is used to convert the value of the specified Decimal to the equivalent 64-bit signed integer (long). This method truncates the decimal portion, returning only the whole number part. Syntax Following is the syntax − public static long ToInt64(decimal val); Parameters val − The decimal number to convert to a 64-bit signed integer. Return Value This method returns a long value that represents the truncated decimal value. The fractional part is discarded, not rounded. How It Works The method performs ...
Read MoreDateTime.FromFileTime() Method in C#
The DateTime.FromFileTime() method in C# converts a Windows file time to an equivalent local time. Windows file time represents the number of 100-nanosecond intervals that have elapsed since 12:00 midnight, January 1, 1601 A.D. (UTC). Syntax Following is the syntax − public static DateTime FromFileTime(long fileTime); Parameters The method takes one parameter − fileTime − A Windows file time expressed in ticks (100-nanosecond intervals since January 1, 1601 UTC). Return Value Returns a DateTime object that represents the local time equivalent of the Windows file time ...
Read MoreDateTime.FromFileTimeUtc() Method in C#
The DateTime.FromFileTimeUtc() method in C# converts a Windows file time to an equivalent UTC DateTime. This method is useful when working with file timestamps or system-level operations that use Windows file time format, which represents time as the number of 100-nanosecond intervals since January 1, 1601 UTC. Syntax Following is the syntax − public static DateTime FromFileTimeUtc(long fileTime); Parameters The method accepts the following parameter − fileTime − A Windows file time expressed in ticks (100-nanosecond intervals since January 1, 1601 UTC). Return Value Returns a DateTime object ...
Read More