Discard Pattern (_)
The discard pattern _ matches any value and is used as a default.
int score = 85;string grade = score switch{ >= 90 => "A", >= 80 => "B", >= 70 => "C", _ => "F"};Console.WriteLine(grade);Run the Application
Section titled “Run the Application”dotnet runResult
Section titled “Result”B