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

cC 1 1

How to Clean a String: A Better Approach Cleaning a string is a common task in programming, especially when dealing with user input or data processing. There are various methods and approaches to achieve this, each with its own advantages and disadvantages. In this article, we will explore different ways to clean a string in …

Read more

c 209

How to Get the Serial Number of a USB Stick in C#

Prerequisites Before we begin, make sure you have a basic understanding of C# programming and have a development environment set up. You will also need to add a reference to the System.Management assembly in your project. Step 1: Import the Required Namespace To access the necessary classes and methods for retrieving the serial number of …

Read more

c 986

Understanding TryParse in C# if condition

What is TryParse? In C#, TryParse is a method that is used to convert a string representation of a number to its equivalent numeric value. It is a safer alternative to the traditional Parse method, as it does not throw an exception if the conversion fails. Instead, it returns a boolean value indicating whether the …

Read more

c 1431

Using Case/Switch and GetType to Determine the Object

When working with object-oriented programming languages like C#, it is often necessary to determine the type of an object at runtime. This can be useful in various scenarios, such as implementing different behavior based on the type of an object or performing specific operations on objects of different types. In C#, there are several ways …

Read more

c 870

How to Remove Objects with a Duplicate Property from a List in C#

Have you ever encountered a situation where you have a list of objects and you want to remove the objects that have duplicate values for a specific property? In this article, I will show you how to achieve this in C# without using any third-party libraries. What is the Problem? Let’s say you have a …

Read more

c 2353

Creating a Constant Dictionary in C#

How to Create a Constant Dictionary To create a constant dictionary in C#, we can leverage the switch-case statement. According to the C# specification, switch-case tables are compiled to constant hash jump tables, which essentially act as constant dictionaries. Let’s take a look at an example: switch (myString) { case “cat”: return 0; case “dog”: …

Read more

c 1753

Asynchronously Wait for Task to Complete with Timeout

Have you ever encountered a situation where you need to wait for a task to complete, but you also want to set a timeout in case the task takes too long? This scenario is quite common in asynchronous programming, and luckily, C# provides a straightforward solution to handle it. How to Wait for Task to …

Read more

c 1092

Unit Testing the Dependency Injection in C#

What is Dependency Injection? Dependency injection is a design pattern that promotes loose coupling between classes by allowing dependencies to be provided from external sources. Instead of a class creating its own dependencies, those dependencies are passed to the class through its constructor, properties, or method parameters. This allows for easier testing, as dependencies can …

Read more

c 576

Is it possible to set localStorage or Session variable in ASP.NET page and read it in JavaScript on the other page?

Understanding localStorage and Session Variables Before we dive into the main question, let’s briefly understand what localStorage and Session variables are. localStorage localStorage is a web storage API that allows you to store key-value pairs in the client’s web browser. The data stored in localStorage persists even after the browser is closed and can be …

Read more

c 1813

How to Get the Current Date without the Time in C#

As a C# programmer, you may often come across situations where you need to retrieve the current date without the time component. In this article, we will explore different approaches to achieve this in C#. Method 1: Using DateTime.Today Property The simplest way to get just today’s date without the time is by using the …

Read more