Your C# Learning Hub

Free C# tutorials with practical code examples: fundamentals, Blazor, MAUI, IoT, and more.

In this tutorial, we will explore three approaches for including placeholders in our strings, and we will determine the best C# syntax for including expressions directly within our string assignments. ... Read more →

The inline conditional operator, or ternary ( ?: ) operator, in C# is a useful shorthand for replacing an If... Else... statement. In this tutorial, we will learn how and when to use the conditional operator. ... Read more →

In this tutorial, we will learn about the if... else... and if... else if... conditional statements and use them to add logic to our C# programs. The if... statements in C# will help us as we begin to write more advanced programs. ... Read more →

This tutorial will teach you how to take input from a user in C# using the Console.ReadLine() method. When writing a computer program, you will often rely on a user interacting with your program. For example, your program may ask the user a question, wait for a response, and then ... Read more →

In this tutorial, we will learn how to declare variables in C# and how to initialize them with values. We will also learn about different C# data types for our variables. ... Read more →

If you are new to C#, the concepts of classes, methods, and properties can be overwhelming. In this tutorial, we will learn the difference between each of these and give a real-world example of how to create a C# class with methods. These definitions will help you get a good ... Read more →