Answers for "c# reference lamda switch"

C#
4

switch with lambda c#

//called: switch expressions

int number= 2;

string result = number switch
{
    0 => "zero",
    1 => "one",
    2 => "two",
    _ => "default"
};

Console.WriteLine(result);
Posted by: Guest on March-16-2022

C# Answers by Framework

Browse Popular Code Answers by Language