c# switch expression 8.0 code example
Example: c# switch expression 8.0
int num = 1;
string message = num switch{
1 => "The Fruits is red",
2 => "The Fruits is green",
3 => "The Fruits is blue"
};
// Message: The Fruits is red
int num = 1;
string message = num switch{
1 => "The Fruits is red",
2 => "The Fruits is green",
3 => "The Fruits is blue"
};
// Message: The Fruits is red