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 863 of 2109
Type.GetNestedTypes() Method in C#
The Type.GetNestedTypes() method in C# is used to get the types nested within the current Type. This method is particularly useful when working with reflection to discover and work with nested classes, interfaces, or other types defined within a class. Syntax Following is the syntax for the GetNestedTypes() method − public Type[] GetNestedTypes(); public abstract Type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr); Parameters The overloaded version accepts a BindingFlags parameter that specifies which nested types to return − bindingAttr − A combination of BindingFlags values that control which nested types are returned (e.g., Public, NonPublic, ...
Read MoreDateTimeOffset.Add() Method in C#
The DateTimeOffset.Add() method in C# returns a new DateTimeOffset object that represents the original date and time with a specified time interval added to it. This method is useful for performing date and time arithmetic while preserving the original offset information. Syntax Following is the syntax − public DateTimeOffset Add(TimeSpan timespan); Parameters timespan − A TimeSpan object that represents the time interval to add. This can be positive (to add time) or negative (to subtract time). Return Value Returns a new DateTimeOffset object whose value is the sum of ...
Read MoreDateTimeOffset.AddDays() Method in C#
The DateTimeOffset.AddDays() method in C# returns a new DateTimeOffset object that adds a specified number of whole and fractional days to the value of the current instance. This method allows you to add or subtract days while preserving the original timezone offset information. Syntax Following is the syntax − public DateTimeOffset AddDays(double days); Parameters days − A number of whole and fractional days. The value parameter can be negative or positive. Return Value Returns a new DateTimeOffset object whose value is the sum of the date and time represented ...
Read MoreDateTimeOffset.AddHours() Method in C#
The DateTimeOffset.AddHours() method in C# is used to add a specified number of whole and fractional hours to the value of a DateTimeOffset instance. This method returns a new DateTimeOffset object that represents the original date and time plus the specified hours, while preserving the original offset from UTC. Syntax Following is the syntax − public DateTimeOffset AddHours(double hours); Parameters hours − A double value representing the number of hours to add. This can be a whole number or fractional value. To subtract hours, provide a negative value. Return Value Returns ...
Read MoreDateTimeOffset.AddMilliseconds() Method in C#
The DateTimeOffset.AddMilliseconds() method in C# returns a new DateTimeOffset object that adds a specified number of milliseconds to the value of the current instance. This method is useful for precise time calculations where millisecond accuracy is required. The method accepts a double parameter representing the number of milliseconds to add. To subtract milliseconds, pass a negative value. The original DateTimeOffset instance remains unchanged as this method returns a new instance. Syntax Following is the syntax − public DateTimeOffset AddMilliseconds(double value); Parameters value − A double representing the number of milliseconds to ...
Read MoreBoolean.Equals(Boolean) Method in C#
The Boolean.Equals(Boolean) method in C# returns a value indicating whether this instance is equal to a specified Boolean object. This method compares the current Boolean instance with another Boolean value and returns true if they are equal, otherwise false. Syntax Following is the syntax − public bool Equals(bool obj); Parameters obj − A Boolean value to compare to this instance. Return Value This method returns true if obj has the same value as this instance; otherwise, false. Example Let us see an example to implement the Boolean.Equals(Boolean) ...
Read MoreBoolean.Equals(Object) Method in C#
The Boolean.Equals(Object) method in C# returns a value indicating whether the current Boolean instance is equal to a specified object. This method compares the Boolean value with another object, returning true only if the object is also a Boolean with the same value. Syntax Following is the syntax − public override bool Equals (object obj); Parameters obj − An object to compare with this Boolean instance. Return Value Returns true if the object is a Boolean instance with the same value; otherwise, false. Using Boolean.Equals() with Different Data Types ...
Read MoreBoolean.Parse() Method in C#
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 MoreBoolean.ToString() Method in C#
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 MoreType.GetProperties() Method in C#
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