What is pattern matching in C#?

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

Explanation

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