LANGUAGE
Discard pattern
Matches any input in a switch expression, including null. Put narrower arms before it.
Formal Syntax & Structure
csharp syntaxcsharp
_Working Example
Example Snippetcsharp
string? title = null;System.Console.WriteLine(title switch { "Atlas" => "known", _ => "other" });