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 […]
How to Get the File Size in C# ?
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.
How to get last four characters from a string in C#?
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. […]
How to Skip Iteration of a foreach loop in C# ?
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 […]
How to Calculate MD5 checksum for a file in C# ?
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 […]
What is the best data type for Currency in C#?
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 […]
C# Program – How to Escape Braces ?
This post shows you a quick way on how you can escape braces or curly brackets in C# when using string format.
C# Program – Generate Random Alphanumeric String
This post explains how you can generate a random alphanumeric string in C#.
C# Program – Multiline string literal 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 […]
C# – How to Call the base constructor ?
In C#, You can call the base constructor using the base keyword as shown below. How to Call the base constructor in C# ?
- 1
- 2
- 3
- …
- 53
- Next Page »