沙沙的兔子 2020-11-23 14:38 采纳率: 0%
浏览 297

C# 中叹号点(!.)是什么运算符?

看到一些源码,使用了这个运算符,去微软那里搜索也查不到。

            for (int i = 0; i < children.Count; ++i)
            {
                if (!Equals(children[i], other!.children[i]))
                {
                    return false;
                }
            }
  • 写回答

1条回答 默认 最新

  • 天天开会 2021-11-26 17:41
    关注

    白小僧大小的Furion源码InternalApp类的SplitConfigFileNameToGroups同样适用了该写法:我也不会。

    //
            // Summary:
            //     对配置文件名进行分组
            //
            // Parameters:
            //   configFiles:
            private static IEnumerable<IGrouping<string, string>> SplitConfigFileNameToGroups(IEnumerable<string> configFiles)
            {
                return configFiles.GroupBy(new Func<string, string>(Function));
                static string Function(string file)
                {
                    string[] array = Path.GetFileName(file)!.Split('.', StringSplitOptions.RemoveEmptyEntries);
                    if (array.Length == 2)
                    {
                        return array[0];
                    }
    
                    return string.Join('.', array.Take(array.Length - 2));
                }
            }
    
    
    评论

报告相同问题?

悬赏问题

  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?
  • ¥100 求三轴之间相互配合画圆以及直线的算法
  • ¥100 c语言,请帮蒟蒻写一个题的范例作参考
  • ¥15 名为“Product”的列已属于此 DataTable
  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题