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 219 of 840
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 MoreCharEnumerator.Dispose() Method in C#
The CharEnumerator.Dispose() method in C# is used to release all resources used by the current instance of the CharEnumerator class. This method implements the IDisposable interface and should be called when you're finished using the enumerator to ensure proper resource cleanup. Syntax Following is the syntax for the CharEnumerator.Dispose() method − public void Dispose(); Parameters This method does not take any parameters. Return Value This method does not return any value (void). Using CharEnumerator.Dispose() Method Example 1: Basic Usage The following example demonstrates how to use the Dispose() ...
Read MoreDateTime.GetTypeCode() Method in C#
The DateTime.GetTypeCode() method in C# is used to return the TypeCode for the DateTime value type. The returned value is the enumerated constant TypeCode.DateTime. This method is inherited from the IConvertible interface and is primarily used in scenarios where you need to determine the type code of a DateTime object programmatically, such as in reflection or type conversion operations. Syntax Following is the syntax − public TypeCode GetTypeCode(); Return Value The method returns TypeCode.DateTime, which is an enumerated constant that represents the DateTime type. Using GetTypeCode() with Current DateTime 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 MoreDictionary.Clear Method in C#
The Dictionary.Clear() method in C# removes all key/value pairs from the Dictionary. This method is useful when you need to empty a dictionary completely while keeping the dictionary object itself for future use. Syntax public void Clear(); Parameters The Clear() method takes no parameters. Return Value The Clear() method does not return any value. It has a void return type. Dictionary.Clear() Operation Before Clear() Key1: Value1 Key2: Value2 Key3: Value3 ...
Read MoreDateTime.IsDaylightSavingTime() Method in C#
The DateTime.IsDaylightSavingTime() method in C# determines whether a specific DateTime instance falls within the daylight saving time range for the current time zone. This method returns true if the date and time are within the DST period, and false otherwise. This method is particularly useful when working with time-sensitive applications that need to account for seasonal time changes in different regions. Syntax Following is the syntax for the DateTime.IsDaylightSavingTime() method − public bool IsDaylightSavingTime(); Return Value The method returns a bool value − true − if the DateTime instance is ...
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 MoreChar.IsWhiteSpace() Method in C#
The Char.IsWhiteSpace() method in C# is used to determine whether a specified Unicode character is classified as white space. This includes spaces, tabs, line feeds, carriage returns, and other Unicode whitespace characters. Syntax Following is the syntax for the Char.IsWhiteSpace() method − public static bool IsWhiteSpace(char ch); Parameters ch − The Unicode character to evaluate. Return Value Returns true if the character is a whitespace character; otherwise, false. Char.IsWhiteSpace() Method Input char ch ...
Read MoreDateTime.IsLeapYear() Method in C#
The DateTime.IsLeapYear() method in C# is used to determine whether a specified year is a leap year. This static method returns true if the year is a leap year, and false otherwise. A leap year occurs every 4 years, with exceptions for century years that are not divisible by 400. Syntax Following is the syntax − public static bool IsLeapYear(int year); Parameters year − An integer representing the year to be checked. The year must be between 1 and 9999. Return Value Returns a bool value − ...
Read More