Welcome to the C# tutorials. These start with interactive lessons that you can run in your browser. Later tutorials and more advanced tutorials help you work with the .NET development tools to create C# programs on your machine.
Introduction to C# interactive tutorials
If you want to start your exploration in video format, the C# 101 video series provides an introduction to C#. You'll learn about concepts you can explore in these tutorials.
The first lessons explain C# concepts using small snippets of code. You'll learn the basics of C# syntax and how to work with data types like strings, numbers, and booleans. It's all interactive, and you'll be writing and running code within minutes. These first lessons assume no prior knowledge of programming or the C# language.
In the Hello world tutorial, you'll create the most basic
C# program. You'll explore the
string type and how to work with text.
In the Numbers in C# tutorial, you'll learn how computers store numbers and how to perform calculations with different numeric types. You'll learn the basics of rounding, and how to perform mathematical calculations using C#. This tutorial is also available to run locally on your machine.
This tutorial assumes that you have finished the Hello world lesson.
The Branches and loops tutorial teaches the basics of selecting different paths of code execution based on the values stored in variables. You'll learn the basics of control flow, which is the basis of how programs make decisions and choose different actions. This tutorial is also available to run locally on your machine.
The List collection lesson gives you a tour of the List collection type that stores sequences of data. You'll learn how to add and remove items, search for items, and sort the lists. You'll explore different kinds of lists. This tutorial is also available to run locally on your machine.
This tutorial assumes that you have finished the lessons listed above.
All the introductory tutorials following the Hello World lesson are available in your own local development environment. At the end of each tutorial, you decide if you want to continue with the next lesson online or on your own machine. There are links to help you set up your environment and continue with the next tutorial on your machine.
Explore new features in C#
- String Interpolation: demonstrates how to use string interpolation to create formatted strings in C#.
- Nullable reference types: demonstrates how to use nullable reference types to express your intent for null references.
- Update a project to make use of Nullable reference types: demonstrates techniques to upgrade an existing project to make use of nullable reference types.
- Extend data capabilities using pattern matching: demonstrates how to use pattern matching to extend types beyond their core features.
- Work with data sequences using indexes and ranges: Demonstrates new convenient syntax for accessing single elements or ranges of a sequential data container.
The following tutorials enable you to build C# programs using .NET Core:
- Console Application: demonstrates Console I/O, the structure of a Console application, and the basics of the task-based asynchronous programming model.
- REST Client: demonstrates web communications, JSON serialization, and object-oriented features in the C# language.
- Inheritance in C# and .NET: demonstrates inheritance in C#, including the use of inheritance to define base classes, abstract base classes, and derived classes.
- Working with LINQ: demonstrates many of the features of LINQ and the language elements that support it.
- Using Attributes: demonstrates how to create and use attributes in C#.
- String interpolation tutorial shows you how to insert values into a string. You'll learn how to create an interpolated string with embedded C# expressions and how to control the text appearance of the expression results in the result string. This tutorial is also available to run locally on your machine.