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 218 of 840
Uri.FromHex() Method in C#
The Uri.FromHex() method in C# converts a single hexadecimal digit character to its corresponding decimal integer value. This static method is part of the Uri class and is commonly used when working with URL encoding and decoding operations. Syntax Following is the syntax − public static int FromHex(char digit); Parameters digit − A hexadecimal digit character (0-9, a-f, A-F) to convert to its decimal equivalent. Return Value Returns an int value representing the decimal equivalent of the hexadecimal digit. The method throws an ArgumentException if the character ...
Read MoreMath Class in C#
The Math class in C# provides static methods and constants for trigonometric, logarithmic, and other mathematical functions. This class is part of the System namespace and offers essential mathematical operations without requiring instantiation. The Math class includes important mathematical constants like Math.E and Math.PI, along with numerous methods for calculations such as power, trigonometric, and logarithmic functions. Math Constants Math.E The Math.E field represents the natural logarithmic base, specified by the mathematical constant e − public const double E = 2.71828182845905; using System; public class Demo { ...
Read MoreChar.IsControl(String, Int32) Method in C#
The Char.IsControl(String, Int32) method in C# determines whether the character at a specified position in a string is a control character. Control characters are non-printable characters used for formatting and text control, such as tab (\t), newline (), and carriage return (\r). Syntax Following is the syntax for the Char.IsControl(String, Int32) method − public static bool IsControl(string str, int index); Parameters str − The string to examine. index − The zero-based position of the character to evaluate in the string. Return Value Returns true if ...
Read MoreUInt16 Struct in C#
The UInt16 struct represents a 16-bit unsigned integer. The UInt16 value type represents unsigned integers with values ranging from 0 to 65, 535. The UInt16 struct provides several useful methods for comparison, equality checking, and string conversion operations. Let us explore the key methods with examples. UInt16.CompareTo() Method The UInt16.CompareTo() method compares the current instance to a specified object or UInt16 and returns an indication of their relative values. Syntax Following are the syntax overloads − public int CompareTo(object val); public int CompareTo(ushort val); Parameters val − An ...
Read MoreUInt32 Struct in C#
The UInt32 struct represents a 32-bit unsigned integer in C#. The UInt32 value type represents unsigned integers with values ranging from 0 to 4, 294, 967, 295 (2³² - 1). This struct provides several useful methods for comparison, equality checking, and value manipulation. Let us explore the key methods with practical examples. Syntax Following is the syntax for declaring a UInt32 variable − uint variableName = value; UInt32 variableName = value; The uint keyword is an alias for UInt32 and both can be used interchangeably. UInt32 Value Range ...
Read MoreChar.IsSymbol() Method in C#
The Char.IsSymbol() method in C# determines whether a specified character is categorized as a symbol character. Symbol characters include mathematical symbols, currency symbols, and other non-alphanumeric characters that are not punctuation or control characters. Syntax The method has two overloads − public static bool IsSymbol(char c); public static bool IsSymbol(string str, int index); Parameters c − The Unicode character to evaluate. str − A string containing the character to evaluate. index − The position of the character to evaluate in the string. Return Value Returns true if the character ...
Read MoreDateTime.FromOADate() Method in C#
The DateTime.FromOADate() method in C# converts an OLE Automation Date value into a DateTime object. OLE Automation Date is a floating-point representation of dates and times where the integer part represents the number of days since December 30, 1899, and the fractional part represents the time of day. Syntax Following is the syntax for the DateTime.FromOADate() method − public static DateTime FromOADate(double d); Parameters The method takes a single parameter − d: A double-precision floating-point number representing the OLE Automation Date value. It can range from -657435.0 to 2958465.99999999. ...
Read MoreChar.IsUpper() Method in C#
The Char.IsUpper() method in C# determines whether a specified Unicode character is categorized as an uppercase letter. It returns true if the character is an uppercase letter, otherwise false. Syntax Following is the syntax of the Char.IsUpper() method − public static bool IsUpper(char ch); Parameters ch − The Unicode character to evaluate. Return Value This method returns a bool value − true if the character is an uppercase letter false if the character is not an uppercase letter Using ...
Read MoreDateTime.GetDateTimeFormats() Method in C#
The DateTime.GetDateTimeFormats() method in C# converts a DateTime instance to all string representations supported by the standard date and time format specifiers. This method is useful for discovering all possible formatted outputs for a given DateTime value. Syntax Following are the two overloads of the method − public string[] GetDateTimeFormats() public string[] GetDateTimeFormats(char format) Parameters format − A standard date and time format character that specifies which format patterns to return (optional). Return Value Returns a string[] containing all possible string representations of the DateTime value using ...
Read MoreCharEnumerator.Clone() Method in C#
The CharEnumerator.Clone() method in C# is used to create a copy of the current CharEnumerator object. This method returns an object that must be cast to CharEnumerator to use its functionality. The cloned enumerator maintains the same position as the original enumerator at the time of cloning. Syntax public object Clone(); Return Value Returns an object that is a copy of the current CharEnumerator instance. The returned object must be cast to CharEnumerator to access enumerator-specific methods. Using CharEnumerator.Clone() The following example demonstrates how to create and use a cloned CharEnumerator − ...
Read More