ToDictionary


var NNN = new int[4] { 11, 22, 33, 44 };

var newNNN = NNN.ToDictionary(m => m, n1 => NNN.Select((a, index) => new { a, index }).FirstOrDefault(b => b.a == n1).index);


Console.WriteLine(newNNN[22]); //1

原文地址:https://www.cnblogs.com/xjt360/p/5599698.html