[C#] Linq / index, value
ㆍindex, value 사용 using System; using System.Linq; class ex { static void Main(string[] args) { int[] a = new int[] { 1, 2, 4 }; string[] b = new string[] { "a", "b", "c", "d" }; var query = from i in a.Select((value, index) => new { index, value }) from s in b.Select((value, index) => new { index, value }) where i.value == (s.index + 1) select new { i = i.value, s = s.value }; foreach (var item ..