Practical solutions

C# Howtos How-To Guides

Solve the problem. Keep building. Collection of C# how-to articles

Find the answer you need

Browse practical solutions, grouped by the task you're working on.

__COUNT__ entries on this page

How to Efficiently Remove All Whitespaces From a String in C#This how-to article shows different methods to efficiently remove all whitespaces from a string in C#. It introduces methods like Regex.Replace(), String.Replace() and Where method How to Convert a Char to an Int in C#This how-to article shows different methods to convert a char to an int in C#. It introduces methods like GetNumericValue(), Difference with 0, Int32.Parse() and GetDecimalDigitValue() How to Convert Byte Array to String in C#This how-to article shows different methods to convert a byte array to a string in C#. It introduces methods like Encoding.GetString() and MemoryStream How to Make a Textbox That Only Accepts Numbers in C#This how-to article shows different methods to make a textbox that only accepts numbers in C#. It introduces methods like Regex.IsMatch(), NumericUpDown() and KeyPressEventArgs class How to Round a Decimal Value to 2 Decimal Places C#This how-to article shows different methods to round a decimal value to 2 decimal places in C#. It introduces methods like decimal.Round() and Math.Round() methods How to Convert String to Datetime in C#This C# string to datetime how-to article shows different methods to convert a string to datetime in C#. It introduces methods like Convert.ToDateTime() method, DateTime.Parse() method and DateTime.ParseExact() method How to Sort a List by a Property in the Object in C#This article introduces how to sort a list by a property in the object in C#. It includes OrderBy method and delegate. How to Pass a Method as a Parameter in C# FunctionThis article introduces various ways of how to pass a method as a parameter in C#. How to Convert an IEnumerable to a List in C#This article introduces various methods and scenarios for converting an IEnumerable to a List in C#. How to Make a Delay Timer in C#This article introduces how to make a delay timer in C#. It includes four different methods: Thread.Sleep(), Task.Delay(), System.Timers.Timer, and System.Threading.Timer. How to Convert a String to Float in C#This article introduces how to convert a string to float in C#. It includes the Parse() method and ToDouble() method. How to Convert a String to Boolean in C#This article introduces how to convert a string to boolean in C#. It includes ToBoolean() method and TryParse() method. How to Sort an Array in Descending Order in C#This article introduces how to sort an array in descending order in C#. It includes Array.Sort() method, Array.Reverse() method and OrderByDescending() method. How to Force Garbage Collection in C#We will delve into different methods to trigger garbage collection in C#, providing detailed examples and explanations for each approach. C# Private SetIn this article, we will look into the intricacies of C# private set, exploring its syntax, use cases, advantages, and potential pitfalls. Modulo Operator in C#This tutorial introduces the modulo operator in C# to get the division remainder. How to Create SQL Database in C#In this tutorial, you will learn how to create an SQL database, as well as how to store and retrieve data from tables inside that database. Interface vs Abstract Classes in C#This article teaches us the difference between interface and abstract classes. How to Generate Random Numbers in Unity3DThis article demonstrates the methods to generate integer and floating point random numbers within a specific range using unity3d with C#. How to Overload Assignment Operator in C#In this article, we will explore different methods to overload assignment operator in C#, providing detailed examples for each approach. How to Add Items to ListView in C#A programming guide about using a ListView control in Windows Forms Application in C#. How to Add an Item to a ListBox in C# and WinFormsThis tutorial will teach how to add an item to a ListBox using the C# and WinForms. Lambda Expression in LINQ Statements in C#This is a programming tutorial about Lambda expressions in LINQ select queries. How to Create the Serializable Attribute in C#This tutorial shows how to create and use the serializable attribute in C#.