Which C# feature introduced pattern matching capabilities?

  1. for loops
  2. if-else statements
  3. switch expressions
  4. while loops

Explanation

Switch expressions, introduced in C# 8.0, provide powerful pattern matching capabilities, allowing more concise and expressive conditional logic compared to traditional switch statements.