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 Get ASCII Value of Character in C#We will explore the 2 main methods that can get the ASCII values of all the characters in a string in C#, the typecasting method and the byte[] method. How to Add a Tab to a String in C#The escape character can be used to add a tab inside a string variable in C#. How to Properly Exit an Application in C#There are 2 main methods that can be used to exit an application in C#, the Environment.Exit() function, and the Application.Exit() function. How to Convert Stream to Byte Array in C#This article will discuss five different methods to convert streams into byte arrays in C#. How to Check if List Is Empty in C#We'll discuss three methods that can be utilized to check if a list is empty or not in C#: the List.Count method, the List.Any() function and the is null check. How to Escape Double Quotes in C#There are various methods that can be used to escape double quotes in C#. How to Convert Integer to Binary in C#There many ways to convert an integer to binary in C# and we will discuss all of them in this article. How to Get Dictionary Key by Value in C#This article explores various methods that can be used to get a dictionary key based on its corresponding value in C#. How to MySql Connection in C#We can connect to a MySql data base with the MySql.Data package in C#. How to Compare Two Strings by Ignoring Case in C#There are several methods that can be used to perform case-insensitive string comparison in C#, the String.ToUpper(), String.ToLower(), String.Equals(), and String.Compare(). How to Merge Two Arrays in C#There are 3 main methods that can be used to merge two arrays in C#, the Array.Copy() function, the Array.Resize() function, and the Linq method. How to Truncate a String in C#We will discuss different methods on how to truncate a string in C#. How to Sort DataTable in C#There are several methods that can be used to sort a datatable in C#. Each method has its unique syntax and use cases, offering flexibility based on specific sorting requirements. How to Shuffle an Array in C#In this article we'll discuss the three ways that can be used to shuffle an array in C#. How to Read Integer From Console in C#This article explores various methods for reading integer values from the console in C#, providing insights into when and how to use each approach. How to Have Numbers Only in TextBox in C#There are two main methods that can be used to create a text box that only accepts numbers in C#, the NumberUpDown View and the TextBox view. How to Convert String to Hex in C#There are various methods that can be used to convert a string to hexadecimal format in C#, and we will discuss them all here. How to Convert Int to Bool in C#There are two main methods that can be used to convert integer to bool in C#, the Convert.ToBoolean() function and the switch statement. How to Read XLSX File in C#There are 2 main methods that can be used to read an xlsx file in C#, the LinqToExcel package, and the ExcelDataReader package. How to Convert Enum to String in C#There are two main methods that can be used to convert an enum to a string in C#, the Description attribute, and the switch method. How to Convert List to IEnumerable in C#There is no need to convert a List to an IEnumerable because the List data structure already implements the IEnumerable interface but we can still use some methods to cast a List to an IEnumerable data structure. How to Convert JSON String to C# ObjectThis tutorial demonstrates how to convert a JSON string to C# by using the DeserializeObject function provided by the Newtonsoft.Json package or the JavaScriptSerializer How to Create an Input Dialog Box in C#This tutorial demonstrates how to create an input dialog box in C# using the Visual Basic InputBox or a custom dialog box How to Initialize an Empty Array in C#This tutorial demonstrates how you can initialize an empty array in C#