switch Statement in C# — a practical guide to C# switch statement with clear examples you can reuse in real projects.
C# Tutorial Series (29/121). Prefer one article? Read the complete C# tutorial.
Short description
Switch expressions are concise for mapping values.
Switch expression
var label = status switch
{
"paid" => "Completed",
"pending" => "Waiting",
_ => "Other"
};