Answers for "switch int statement c#"

C#
6

switch expression c#

var switchValue = 3;
var resultText = switchValue switch
{
    1 or 2 or 3 => "one, two, or three",
    4 => "four",
    5 => "five",
    _ => "unknown",
};
Posted by: Guest on March-07-2021

C# Answers by Framework

Browse Popular Code Answers by Language