使用Array.IndexOf排序。

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

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

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
  • 2021-11-25
  • 2022-12-23
  • 2021-11-23
  • 2021-08-07
猜你喜欢
  • 2021-04-03
  • 2022-12-23
  • 2022-12-23
  • 2021-11-09
  • 2022-12-23
  • 2021-07-31
相关资源
相似解决方案