What is pattern matching in C#?

  1. Technique for checking value shapes and extracting data
  2. String pattern search
  3. File pattern matching
  4. Regular expressions

Explanation

Pattern matching allows you to test if a value has a certain shape and extract information from the value when it does.