空条件指数

与 ?. 运算符类似,null 条件索引运算符在索引到可能为 null 的集合时检查空值。

string item = collection?[index];

是语法糖

string item = null;
if(collection != null)
{
    item = collection[index];
}