Quiz: How Ranges in C# 8 work

Ranges in C# 8 is a nice new feature that allows slicing collections using a very simple syntax.

This quiz made of a single line of C# 8 can help you understand how Ranges in C# 8 work.

What does this program print to the console? Why?

Post your answer in the comments section below and share the quiz with you friends and colleagues.

How Ranges work in C# 8

In addition, if you want to learn more about Ranges and Indexes check out the Ranges proposal on the official Github project.

To run and play with Ranges you need to install Visual Studio 2019 Preview, .NET Core 3.0 SDK and enable C# 8 by setting the LangVersion tag to 8.0 in your csproj file.

Happy C# coding 🙂

Sharing is Caring
  • Tommy Williams says:


  • >