Skip to content

๐Ÿ’ป Pattern Matching (C# 7)

string TypeOf(object o) => o switch
{
int n when n > 0 => ">0",
int => "int",
string s => $"str:{s.Length}",
_ => "other"
};