What is pattern matching in C#?

  1. String pattern search
  2. Regular expressions
  3. Technique for checking value shapes and extracting data
  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.