DS Algo

Data Structure & Algo

Arrays, Linked Lists, Stacks, Queues Trees, Graphs, Hash Tables, Dynamic Programming

Programming

Programming Languages

C++, Java, Python, JavaScript Swift, Go, Rust, C# Kotlin, Ruby, PHP, SQL

Robotics

Automation Testing

UI Automation, API Automation,Mobile,Security,RPA,PRA,Performance

GET IN TOUCH

Schedule a Demo

Our Posts

c 463

C# Triple Double Quotes: What are they and how to use them?

In C# programming language, triple double quotes (“””) are a special syntax known as raw string literals. They provide a convenient way to work with strings that contain quotes or embedded language strings like JSON, XML, HTML, SQL, Regex, and others. Raw string literals eliminate the need for escaping characters, making it easier to write …

Read more

c 1084

Best Practices in Using a Lock in C#

What is a Lock? A lock in C# is implemented using the lock keyword, which ensures that only one thread can enter a specific section of code at a time. When a thread encounters a lock statement, it attempts to acquire a lock on the specified object. If the lock is already held by another …

Read more

c 194

Usage of ‘&’ versus ‘&&’ in C#

‘&’ Operator The ‘&’ operator in C# is a bitwise AND operator. It operates at the bit level, meaning that it performs the AND operation on each corresponding pair of bits in the operands. This operator is commonly used when working with binary data or performing low-level bit manipulation. For example, consider the following code …

Read more

c 1739

How to Add a Badge to a C# WinForms Control

Have you ever wanted to add a badge to a C# WinForms control? Maybe you want to display a notification count on a button or indicate the status of a control. In this article, I will show you how to easily add a badge to a C# WinForms control using a static Adorner class. What …

Read more

c 1524

Switch Case and Generics Checking in C#

How to Use Switch Case with Generics To use switch case statements with generics in C#, you can leverage the TypeCode enum or pattern matching, depending on the version of C# you are using. Using TypeCode Enum (C# 7.0 and earlier) In C# 7.0 and earlier versions, you can use the TypeCode enum to switch …

Read more

c 4658

Why Catch and Rethrow an Exception in C#?

Exceptions are an essential part of any programming language, including C#. They allow us to handle unexpected situations and errors gracefully. In some cases, it may be necessary to catch an exception and then rethrow it. But why would we want to do that? In this article, we will explore the reasons behind catching and …

Read more

c 2793

Sorting a List in C#

How to Sort a List in C To sort a List<int> in C#, we can use the Sort method provided by the List<T> class. The Sort method arranges the elements of the list in ascending order based on their values. Here’s an example of how to use the Sort method: List<int> numbers = new List<int> …

Read more

c 3444

Understanding the Concept of Private Class in C#

What is a Private Class? In C#, a private class is a class that can only be accessed within the scope of the containing class. It is not accessible from outside the containing class or from any other class in the same assembly. Private classes are often used to encapsulate implementation details and hide them …

Read more

c 3073

Can I use IEnumerable a = new IEnumerable()?

If you’re wondering whether you can use the syntax IEnumerable<object> a = new IEnumerable<object>(), the answer is no. The reason is that IEnumerable<T> is an interface, and interfaces cannot be instantiated directly. However, you can create an instance of a class that implements IEnumerable<T> and assign it to a variable of type IEnumerable<T>. How to …

Read more

c 3770

Access Enumerator within a foreach loop: How to Manipulate and Control the Enumerator

Scenario Let’s consider a scenario where you have a list of payments and you want to iterate over them using a foreach loop. However, you only want to consider payments that meet a certain criteria, such as being above a certain threshold or contributing to a running total. We will explore two different solutions to …

Read more