📅  最后修改于: 2022-03-11 14:48:41.001000             🧑  作者: Mango
int x = SwitchExpressionUsingGuardClause(y);
// Keywords: Switch Expressions, C# 8.0, Guard Clause
private int SwitchExpressionUsingGuardClause(int y)
{
switch (y)
{
case 0: return 10;
case 1: return 20;
default: return 5;
}
}