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 Delete Object in C#We can delete the object of a user-defined class by assigning a null value to it in C#. How to Create New Instance From Type in C#This tutorial will discuss the methods of creating a new instance of a given data type at runtime in C#. How to Convert Long to Int in C#There are 3 main methods that can be used to convert a long variable to an integer variable in C#, the type casting method, the Convert.ToInt32() function, and checked and unchecked keywords. How to Check Palindrome String in C#There are two main methods that can be used to check whether a string is a palindrome or not in C#, the String.Substring() method and the LINQ method. How to Append to Text File in C#There are three main methods that can be used to append to a text file in C#, the File.AppendAllText() method, the StreamWriter class, and the File.AppendText() How to Close Form in C#This tutorial will explore different methods that can be used to close a form in C#. How to Repeat String in C#There are three main methods that can be used to repeat a string in C#, the String constructor, the Enumerable.Repeat() function in LINQ, and the StringBuilder class. How to Get Executable Path in C#There are 3 main methods that can be used to get the executable path of our program in C#, the Assembly class, the AppDomain class, and the Path class. How to Check if Process Is Running in C#There are two main methods that can be used to check if a process is running in C#, the Process.GetProcessByName() function, and the Process.GetProcessById() function. How to Repeat String X Times in C#In this article, we will explore five different methods to repeat a string x times in C# and discuss when to use each one. How to Remove Duplicates From List in C#There are two main methods that can be used to remove duplicate elements from a list in C#, the HashSet method, and the LINQ method. How to Parse CSV File in C#There are two main methods that can be used to parse a CSV file in C#, the TextFieldParser class, and the FileHelpers library. How to Implement Multiline Label in C#There are two main methods that can be used to create a multiline label in C#, the Label.AutoSize property, and the Panel method. How to Convert String to Char in C#There are four main methods that can be used to convert string to char in C#, char.Parse(), string[index], string.ToCharArray(), and the LINQ method. How to Check if TextBox Is Empty in C#There are two main methods that can be used to check if a text box is empty or not in C#, the String.IsNullOrEmpty() function, and the TextBox.Text.Length property. How to Format Datetime in C#This tutorial demonstrates how to convert a datetime variable to a formatted string using the ToString and String.Format function How to Exit a Function in C#In this tutorial, learn the different methods of exiting a function in C# with examples. Use the break, continue, goto, return, and throw exception statements. How to Convert Boolean to Integer in C#In this tutorial, learn the different methods of converting boolean to integer data type in C# with examples. Use the Convert.ToInt32 keyword. Binary Search Tree in .Net 4.0In this tutorial, understand the implementation of binary search tree in .net 4.0. Use the Sorted Set<T> class. How to Create a Generic Function in C#We can use the type T to declare a generic data type in C#. It can be either used as a function return type or the data type of function parameters. HashSet vs List in C#In C#, a hash set is an unordered collection of unique objects while a list is a collection of objects that can be accessed by an index. C# new vs overrideThe override keyword is used to show the child implementation of a virtual function to its parent object whereas the new keyword is used to hide the child implementation from its parent class object. How to Add a Row in DataGridView Using C#This article explains adding a row to DataGridView in C#. How to Read and Parse an XML File in C#This how-to article shows different methods to read and parse an XML file in C#. It introduces methods like XmlReader.Read(), XmlReader.IsStartElement() and ReadString()