【发布时间】:2018-05-17 05:10:30
【问题描述】:
我有一个整数列表List<int> iFaciltyReqId = new List<int>();,它的元素是
我需要像上面的列表一样订购下面的哈希表(如果元素不存在则需要排除)
结果应该是按顺序排列的键 1153 1168 1155 1152 1176 第676章
我尝试如下,但结果不符合我的期望
foreach (var c in iFaciltyReqId)
{
foreach (var d in ohmItemSeqs.Keys)
{
if (Convert.ToInt32(c) == Convert.ToInt32(d))
{
sortedohmItemSeqs.Add(c, ohmItemSeqs.Values);
}
}
}
【问题讨论】:
-
如果您将minimal reproducible example 作为文本 提供给您,这将更容易为您提供帮助,所有内容都在一个片段中,而不是几个屏幕截图和代码的sn-ps .