Pattern matching is a technique where you test an expression to determine if it has certain characteristics.
C# pattern matching provides more concise syntax for testing expressions and taking action when an expression matches.
The "is" supports pattern matching to test an expression and conditionally declare a new variable to the result of that expression.
The "switch" enables you to perform actions based on the first matching pattern for an expression.
These two expressions support a rich vocabulary of patterns.
© vahid arya. All Rights Reserved.