c# 中的 ? 运算符(空合并运算符)用于提供备用值,当变量可能为 null 时。其语法为 variablename ?? defaultvalue,如果 variablename 不为 null,则返回其值,否则返回备用值。它提供了简洁性、可读性和避免空指针异常的优点。 C# 中的 ? 运算符