AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 226 of 840

Boolean.Parse() Method in C#

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

The Boolean.Parse() method in C# is used to convert the specified string representation of a logical value to its Boolean equivalent. This method converts strings like "true", "false", "TRUE", or "FALSE" to their corresponding boolean values. Syntax Following is the syntax − public static bool Parse(string value); Parameters value − A string containing the value to convert. It can be "true", "false", "True", "False", "TRUE", or "FALSE". Return Value Returns true if the value is equivalent to TrueString, or false if the value is equivalent to FalseString. Using ...

Read More

Convert.ToBase64CharArray() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 332 Views

The Convert.ToBase64CharArray() method in C# converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. This method provides more control than the standard Convert.ToBase64String() by allowing you to specify input and output positions and work directly with character arrays. Syntax Following is the syntax − public static int ToBase64CharArray(byte[] inArray, int offsetIn, int length, char[] outArray, int offsetOut); Parameters inArray − An input array of 8-bit unsigned integers (bytes). offsetIn − A position within the input array to start conversion. ...

Read More

Boolean.ToString() Method in C#

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

The Boolean.ToString() method in C# converts a boolean value to its equivalent string representation. It returns "True" for true values and "False" for false values. Syntax Following is the syntax − public override string ToString(); Return Value The method returns a string that represents the current boolean value − Returns "True" if the boolean value is true Returns "False" if the boolean value is false Using Boolean.ToString() with True Value Example using System; public class Demo { ...

Read More

Type.GetProperties() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 558 Views

The Type.GetProperties() method in C# is used to retrieve information about the properties of a specific type at runtime using reflection. This method returns an array of PropertyInfo objects that represent all the properties of the specified type. Syntax Following are the two main overloads of the GetProperties() method − public PropertyInfo[] GetProperties(); public PropertyInfo[] GetProperties(BindingFlags bindingAttr); Parameters bindingAttr − A bitwise combination of BindingFlags enumeration values that specify how the search is conducted. This parameter controls which properties are returned based on their accessibility and binding characteristics. Return Value ...

Read More

Type.GetTypeArray() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 134 Views

The Type.GetTypeArray() method in C# is used to retrieve the Type objects representing the runtime types of all elements in a specified object array. This method is particularly useful in reflection scenarios where you need to determine the actual types of objects at runtime. Syntax Following is the syntax − public static Type[] GetTypeArray (object[] args); Parameters args − An array of objects whose types are to be determined. Return Value This method returns an array of Type objects representing the types of the corresponding elements in ...

Read More

Convert.ToBase64String() Method in C#

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

The Convert.ToBase64String() method in C# is used to convert the value of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. This is commonly used for encoding binary data into a text format that can be safely transmitted or stored. Syntax Following is the syntax − public static string ToBase64String(byte[] inArray); Parameters inArray − An array of 8-bit unsigned integers to be converted to Base64 string. Return Value Returns a string representation of the contents of the byte array ...

Read More

Type.GetTypeCode() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 280 Views

The Type.GetTypeCode() method in C# is used to get the underlying type code of the specified Type. It returns a TypeCode enumeration value that represents the type classification of the given Type object. Syntax Following is the syntax − public static TypeCode GetTypeCode(Type type); Parameters type − The Type object whose underlying type code is to be retrieved. Return Value Returns a TypeCode enumeration value that represents the type category. If the type is null, it returns TypeCode.Empty. Using GetTypeCode() with Built-in Types Example ...

Read More

Int32. Equals Method in C# with Examples

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 306 Views

The Int32.Equals() method in C# is used to compare the current integer instance with another value to determine if they are equal. It returns a boolean value indicating whether the comparison values are equal or not. Syntax The Int32.Equals() method has two overloaded forms − public bool Equals(int other); public override bool Equals(object obj); Parameters other − An Int32 value to compare with the current instance. obj − An object to compare with the current instance. Return Value Both overloads return a bool value − true if ...

Read More

DateTime.ToShortTimeString() Method in C#

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

The DateTime.ToShortTimeString() method in C# converts a DateTime object to its equivalent short time string representation. This method formats the time portion of the date using the current system culture's short time pattern, typically showing hours and minutes in 12-hour or 24-hour format. Syntax Following is the syntax − public string ToShortTimeString(); Return Value Returns a string that contains the short time string representation of the current DateTime object. Using ToShortTimeString() with Current DateTime This example demonstrates how to use ToShortTimeString() with the current system time and shows the culture-specific formatting ...

Read More

DateTime.ToString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 565 Views

The DateTime.ToString() method in C# converts a DateTime object to its string representation. This method provides multiple overloads to format the date and time according to different requirements using format strings and culture-specific formatting. Syntax The DateTime.ToString() method has four overloads − ToString() ToString(String) ToString(IFormatProvider) ToString(String, IFormatProvider) Parameters format − A standard or custom date and time format string. provider − An object that supplies culture-specific formatting information. Return Value Returns a string representation of the current DateTime object formatted according to the specified format string and culture information. ...

Read More
Showing 2251–2260 of 8,392 articles
« Prev 1 224 225 226 227 228 840 Next »
Advertisements