C# Archive

Replace special characters in c# using regex

Hello Readers, This post emphasizes on how to easily replace special characters from a given string using REGEX in both the programming languages – C# and VB.NET. Replace special characters in c# using regex While working on one of the modules, I came across a requirement to replace all special characters with spaces (” “) and some of them

Convert DOC to PDF using Spire.DOC

Hello Readers, In this post, you will learn to convert Doc to PDF using Spire.Doc with few lines of code. Let us first understand more about Spire.Doc. Introduction to Spire.Doc  is a library designed to convert, create, read and write word document file. This is compatible with ASP.NET and is called . We can get the

Difference between String and StringBuilder in C#

Difference between String and StringBuilder in C# Hello Readers, With the help of this post, I will try to explain the difference between String and StringBuilder in c#. It’s a common interview questions for c#, asp.net developers as well. String String is immutable. Which means once we create string object we cannot modify it.  When we

Difference between String and string in C#

Difference between String and string in C# Hello Readers, In this post, I will explain about the Difference between String and string in C# with help of simple code snippet or one liner code. Actually, string is an alias in C# for System.String. So technically, there is no difference. It’s like int versus System.Int32. But int automatically

What does atomic mean in C#?

What does atomic mean in C#? Hello Readers, Atomic means that an operation is done without the chance for another thread to come in and do something in the middle of it. Explanation with Example Let’s say you have a program with two threads that can both access myClass.Counter. The first thread just loops over

When to use Abstract Class in C#?

When to use Abstract Class in C#? Hello Readers, Abstract classes has always been the hot topic among developers and interviewers when it comes to checking your OOPs knowledge. In my previous post, I have already explained about what are abstract classes and why we cannot create object of an abstract class.  You can refer

Type Checking in C# and VB.NET

Type Checking in C# and VB.NET Hello Readers, Type Checking in programming languages is a program analysis that verifies something about the types that are used in the program. Let’s find out how type checking in c# and vb.net is done? Type Checking in C# In C#, you can use typeof operator and GetType() method to get the types.

Why can’t an object of abstract class be created?

Why can’t an object of abstract class be created? Hello Reader, Many developers already know that it is not possible to create an object of abstract class. However, have you ever wondered why? Why can’t an object of abstract class be created? Let’s find out the reason together. I will first explain a bit about

Armstrong Number in CSharp – Code Optimized

Armstrong Number in CSharp – Code Optimized Howdy Reader, Wondering why a post again on Armstrong number? Well this post is not to duplicate the content already written for finding armstrong number in C# rather to list down some of the critiques (A detailed analysis and assessment) suggested by one of the senior developer – Andy

Armstrong Number in CSharp

Armstrong Number in CSharp Hello Readers, An Armstrong or Narcissistic number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 = 371. It is one of the common programming interview question