C# List根據另外一個List集合或數組排序

使用Array.IndexOf排序。排序

如:List<int> lst=new List<int>{14,8,9,78}; 按  78,8,9,14排序。List

lst = lst.OrderBy(t=>Array.IndexOf(new []{78,8,9,14},t)).ToList();new

相關文章
相關標籤/搜索