当前位置:   article > 正文

C# 遍历键值对获取某个键值对的下标_c# dictionary获取key的下标

c# dictionary获取key的下标

Dictionary<int, int> dicToday = new Dictionary<int, int>();

dicToday .add(1,2);

dicToday .add(1,2);

dicToday .add(1,2);

dicToday .add(1,2);

int vDays =0;

 for (int index = 0; index < dicToday.Count; index++)

            {
                 var item = dicToday.ElementAt(index);
                 if (vDays >= item.Key && vDays <= item.Value)
                 {
                     vDays = index;
                     continue;
                 }  
            }
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/知新_RL/article/detail/977716
推荐阅读
相关标签
  

闽ICP备14008679号