AmitDiwan

AmitDiwan

8,392 Articles Published

Articles by AmitDiwan

Page 209 of 840

Queue.CopyTo() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 306 Views

The Queue.CopyTo() method in C# is used to copy the Queue elements to an existing one-dimensional Array, starting at the specified array index. This method is particularly useful when you need to transfer queue elements into an array while preserving the FIFO (First In, First Out) order. Syntax Following is the syntax for the Queue.CopyTo() method − public virtual void CopyTo(Array arr, int index); Parameters arr − The one-dimensional Array that is the destination of the elements copied from Queue. The Array must have zero-based indexing. index − The ...

Read More

Queue.Count Property in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 231 Views

The Queue.Count property in C# is a read-only property that returns the number of elements currently stored in the Queue collection. This property provides an efficient way to check the size of the queue without needing to iterate through all elements. Syntax The syntax for the Queue.Count property is as follows − public virtual int Count { get; } Return Value The Count property returns an int value representing the total number of elements in the Queue. If the queue is empty, it returns 0. Using Count with Queue Operations The ...

Read More

Queue.Dequeue Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 918 Views

The Queue.Dequeue() method in C# is used to remove and return the object at the beginning of the Queue. This method follows the FIFO (First In, First Out) principle, where the first element added to the queue is the first one to be removed. Syntax Following is the syntax for the Dequeue() method − public T Dequeue(); Return Value The method returns the object that is removed from the beginning of the Queue. If the queue is empty, it throws an InvalidOperationException. Queue.Dequeue() Operation ...

Read More

Remove all the strings from the StringCollection in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 181 Views

The StringCollection class in C# provides the Clear() method to remove all strings from the collection at once. This method is part of the System.Collections.Specialized namespace and is useful when you need to empty the entire collection efficiently. Syntax Following is the syntax for the Clear() method − stringCollection.Clear(); Parameters The Clear() method does not take any parameters. Return Value The Clear() method does not return any value. It has a return type of void. StringCollection.Clear() Process Before Clear() ...

Read More

C# String.IsNormalized Method

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 278 Views

The String.IsNormalized() method in C# is used to indicate whether this string is in a particular Unicode normalization form. Unicode normalization ensures that text with the same meaning has a consistent binary representation, which is important for string comparison and text processing. Syntax The syntax is as follows − public bool IsNormalized(); public bool IsNormalized(System.Text.NormalizationForm normalizationForm); Parameters normalizationForm − A System.Text.NormalizationForm enumeration value that specifies the Unicode normalization form to check against. The possible values are: FormC − Canonical Decomposition followed by Canonical Composition FormD − Canonical Decomposition FormKC − Compatibility ...

Read More

Gets or sets the value at the specified key in StringDictionary in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 161 Views

The StringDictionary class in C# provides an indexer property that allows you to get or set values using a key-based approach. This indexer uses the syntax dictionary[key] to access or modify values at the specified key. Syntax Following is the syntax for getting or setting values using the indexer − // Getting a value string value = stringDictionary[key]; // Setting a value stringDictionary[key] = newValue; Parameters key − A string that represents the key to locate in the StringDictionary. value − The string value to associate with the specified key when ...

Read More

TimeSpan.FromMilliseconds() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 656 Views

The TimeSpan.FromMilliseconds() method in C# is used to return a TimeSpan that represents a specified number of milliseconds. This static method is particularly useful when you need to create time intervals based on millisecond values, such as delays, timeouts, or performance measurements. Syntax Following is the syntax for the TimeSpan.FromMilliseconds() method − public static TimeSpan FromMilliseconds(double value); Parameters The method accepts one parameter − value − A double that represents the number of milliseconds. It can be positive, negative, or zero. Return Value The method returns a TimeSpan ...

Read More

Stack.Contains() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 286 Views

The Stack.Contains() method in C# is used to check whether a specific element exists in the Stack or not. It returns true if the element is found, otherwise false. Syntax The syntax for the Stack.Contains() method is as follows − public virtual bool Contains(object obj); Parameters obj − The object to be searched in the stack. It can be null. Return Value Returns a bool value − true − if the element is found in the Stack false − if the element is not found in the ...

Read More

Gets or sets the value in HybridDictionary with specified key in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 191 Views

The HybridDictionary class in C# provides an indexer property that allows you to get or set values using a specified key. The HybridDictionary is part of the System.Collections.Specialized namespace and combines the benefits of both ListDictionary and Hashtable for optimal performance with small and large collections. Syntax Following is the syntax for getting or setting values in HybridDictionary using the indexer − // Getting a value object value = hybridDict[key]; // Setting a value hybridDict[key] = value; Parameters key − The key of the element to get or set. Can ...

Read More

Boolean.ToString(IFormatProvider) Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 584 Views

The Boolean.ToString(IFormatProvider) method in C# converts a Boolean value to its equivalent string representation. This method accepts an IFormatProvider parameter, though Boolean values are not culture-sensitive and always return "True" or "False" regardless of the culture specified. Syntax Following is the syntax for the Boolean.ToString(IFormatProvider) method − public string ToString(IFormatProvider provider); Parameters provider − An IFormatProvider object that provides culture-specific formatting information. This parameter is reserved but not used for Boolean values. Return Value Returns a string representation of the Boolean value. The method returns "True" for true values ...

Read More
Showing 2081–2090 of 8,392 articles
« Prev 1 207 208 209 210 211 840 Next »
Advertisements