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

posted @ 2016-06-20 09:55  xjt360  阅读(157)  评论(0编辑  收藏  举报