There are times when you have to remove duplicate entried from a List from Your C# program and one of the easiest way to do that is using the combination of the LINQ and IEqualityComparer interface. Assume that you have a list of Actors as shown below ID : 1 , Name = Vijay ,Language […]
If you need a way to get the size of a file in your C# program , you can use the Length property of the FileInfo class. How to Get the File Size in C# ? FileInfo.Length returns the length of the file in bytes.
This post will provide a simple tip showing how you can get the last 4 characters from a string in C#. How to get last four characters from a string in C#? Assume that you have a string that contains the value “CodersEditor.com” and you wish to get .com from the string and display it. […]
When using C# programming language , there are times when you might want to skip over the iteration based on some condition and jump over to the next iteration. How to Skip Iteration of a foreach loop in C# ? continue keyword comes to your rescue for this use case. When you want to skip […]
There are times when you want to calculate MD5 checksum for a file in C# and you can easily do that using System.Security.Cryptography.MD5 You can use the ComputeHash method of the MD5 instance by passing the stream. You can later it to Hex using the BitConverter so that you can represent it as string for […]
If you are looking at finding out what could be the best data type for currency in C# ?, this post will provide a quick tip or insights on the same. What is the best data type for Currency in C#? Use decimal for any currency or money values. The decimal keyword indicates a 128-bit […]
This post shows you a quick way on how you can escape braces or curly brackets in C# when using string format.
This post explains how you can generate a random alphanumeric string in C#.
If you are looking at an easy way to create a multiline string literal in C#, then you use the verbatim string literal as shown in the below code snippet. C# Program – Multiline string literal in C# Using the verbatim stting ensures that it allows multiple lunes and also you donot need to have […]
In C#, You can call the base constructor using the base keyword as shown below. How to Call the base constructor in C# ?