Pattern matching in switch statements

added by DotNetKicks
6/4/2018 1:18:58 PM

2 Kicks, 1593 Views

One of new features introduced by C# 7.0 is support for pattern matching in switch statements. It's like mix of switch and if statements so we don't have to nest these two. This blog post introduces pattern matching in switch statements and shows what C# compiler produces of switch statements.