Skip to content

Glossary: C# Beyond the Basics

switch expression

Also written: switch expressions, arms

A `switch` that picks a value rather than running statements: `x switch { pattern => result, ... }`. The first matching arm wins, so order matters.

Where the book teaches it

Related terms

patterndiscardwhen guard