string strs = null;// 出现异常bool bool1 = strs.Length == 0;// 不会出现异常 strs?.Length 的类型是int?(可为null的int类型)bool bool2 = (strs?.Length ?? 0) == 0;