C# language feature:
applies to
- switch statement, is expressions
benefit
- Allows testing for pattern/type and extracting as type.
how to use
- 1) In
is
statement, insert type after is
followed by variable identifier, use variable in statement as desired.
- 2) In
switch
statement, insert type after case followed by variable identifier, use variable in case statement as desired.
example: