Programming Articles

Page 49 of 2547

Which one is better Build, Rebuild, or Clean in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 318 Views

When working with C# projects in Visual Studio, you have three main build options: Build, Rebuild, and Clean. Each serves a different purpose and understanding when to use each one can significantly improve your development workflow and troubleshoot compilation issues. Build Solution The Build option performs an incremental build, which means it only compiles code files that have changed since the last build. This is the most efficient option for regular development work. Key characteristics of Build − Only compiles modified files and their dependencies Fastest build option for development Preserves existing compiled files that ...

Read More

How to change the visibility of the Cursor of Console in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 479 Views

The Console.CursorVisible property in C# allows you to control whether the cursor is visible in the console window. This property accepts a boolean value where true makes the cursor visible and false hides it. Syntax Following is the syntax for using the Console.CursorVisible property − Console.CursorVisible = true; // Makes cursor visible Console.CursorVisible = false; // Hides cursor To check the current visibility status − bool isVisible = Console.CursorVisible; Example - Hiding the Cursor Let us see an example that demonstrates hiding the cursor − using ...

Read More

Random.NextBytes() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 393 Views

The Random.NextBytes() method in C# is used to fill the elements of a specified byte array with random numbers. Each element in the array receives a random value between 0 and 255 (the range of a byte). Syntax Following is the syntax for the NextBytes() method − public virtual void NextBytes(byte[] buffer); Parameters buffer − An array of bytes to be filled with random numbers. The array must be initialized before calling this method. Return Value This method does not return a value. It modifies the passed byte array ...

Read More

Set all bits in the BitArray to the specified value in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 142 Views

The BitArray.SetAll() method in C# is used to set all bits in the BitArray to a specified boolean value. This method provides an efficient way to initialize or reset all elements in a BitArray with a single operation, rather than setting each bit individually. Syntax Following is the syntax for the SetAll() method − public void SetAll(bool value) Parameters value: A boolean value (true or false) to assign to all bits in the BitArray. Using SetAll() to Set All Bits to True The following example demonstrates setting all bits in a ...

Read More

How to Get Hashtable Elements as Sorted Array?

Shilpa Nadkarni
Shilpa Nadkarni
Updated on 17-Mar-2026 2K+ Views

A Hashtable is a non-generic collection of key-value pairs that are arranged according to the hash code of the key. The hashtable optimizes lookups by calculating the hash code of each key and storing it internally. When accessing a particular value, this hash code is matched with the specified key. This hashtable collection is defined in the System.Collections namespace of C#. The class that represents the hashtable collection is the Hashtable class. By default, hashtable collections are unsorted. To get sorted data, we need to extract the elements into an Array and sort them. Why Hashtables Are Unsorted ...

Read More

What are union, intersect and except operators in Linq C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 701 Views

LINQ set operators in C# allow you to perform set-based operations on collections. The three primary set operators are Union, Intersect, and Except, which enable you to combine, find common elements, and identify differences between sequences. These operators work with any IEnumerable collections and return distinct results by default, making them useful for data manipulation and filtering operations. Syntax Following is the syntax for the three LINQ set operators − // Union - combines two sequences and removes duplicates var result = sequence1.Union(sequence2); // Intersect - returns common elements from both sequences var result ...

Read More

Int64.ToString() Method in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 550 Views

The Int64.ToString() method in C# is used to convert a 64-bit integer (long) value to its equivalent string representation. This method provides multiple overloads for different formatting options, allowing you to control how the numeric value appears as text. Syntax Following are the primary syntax overloads for the Int64.ToString() method − public override string ToString(); public string ToString(string format); public string ToString(IFormatProvider provider); public string ToString(string format, IFormatProvider provider); Parameters format − A numeric format string that specifies how the value should be formatted (optional). provider − An object that supplies culture-specific ...

Read More

Adding new node or value at the end of LinkedList in C#

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 189 Views

The LinkedList class in C# provides the AddLast() method to add new nodes or values at the end of the linked list. This method maintains the sequential order and automatically updates the internal node structure. Syntax Following is the syntax for adding elements at the end of a LinkedList − LinkedList list = new LinkedList(); list.AddLast(value); The AddLast() method has two overloads − public LinkedListNode AddLast(T value) public void AddLast(LinkedListNode node) Parameters value − The value to add at the end of the LinkedList. node − The LinkedListNode ...

Read More

What is explicit implementation and when to use in the interface in C#?

Nizamuddin Siddiqui
Nizamuddin Siddiqui
Updated on 17-Mar-2026 409 Views

Explicit interface implementation in C# allows a class to implement interface members in a way that they can only be accessed through the interface reference, not through the class instance directly. This is particularly useful when a class implements multiple interfaces that have members with the same signature. Syntax Following is the syntax for explicit interface implementation − interface IInterface1 { void Method(); } class MyClass : IInterface1 { void IInterface1.Method() { // explicit implementation } } Note ...

Read More

How to change the WindowLeft of the Console

AmitDiwan
AmitDiwan
Updated on 17-Mar-2026 173 Views

The Console.WindowLeft property in C# gets or sets the leftmost position of the console window area relative to the screen buffer. This property controls the horizontal scrolling position of the console window within the buffer. Syntax Following is the syntax for using the Console.WindowLeft property − Console.WindowLeft = value; int leftPosition = Console.WindowLeft; Parameters The WindowLeft property accepts an int value representing the column position (0-based) where the left edge of the console window should be positioned within the screen buffer. Key Rules The value must be greater than ...

Read More
Showing 481–490 of 25,467 articles
« Prev 1 47 48 49 50 51 2547 Next »
Advertisements