我怎样才能得到列表<T>中的每一个项目？

` `return list.Where((x, i) => i % nStep == 0);` `

` `IEnumerator<T> GetNth<T>(List<T> list, int n) { for (int i=0; i<list.Count; i+=n) yield return list[i] }` `

` `public static class MyListExtensions { public static IEnumerable<T> GetNth<T>(this List<T> list, int n) { for (int i=0; i<list.Count; i+=n) yield return list[i]; } }` `

` `from var element in MyList.GetNth(10) select element;` `

` `from var i in Range(0, ((myList.Length-1)/n)+1) select list[n*i];` `

` `var everyFourth = list.Where((x,i) => i % 4 == 0);` `

For Loop

` `for(int i = 0; i < list.Count; i += n) //Nth Item..` `

` `List<T> list = originalList.Where((t,i) => (i % 5) == 0).ToList();` `

` `public static class LinqExtensions { public static IEnumerable<T> GetNth<T>(this IEnumerable<T> list, int n) { if (n < 0) throw new ArgumentOutOfRangeException("n"); if (n > 0) { int c = 0; foreach (var e in list) { if (c % n == 0) yield return e; c++; } } } public static IEnumerable<T> GetNth<T>(this IList<T> list, int n) { if (n < 0) throw new ArgumentOutOfRangeException("n"); if (n > 0) for (int c = 0; c < list.Count; c += n) yield return list[c]; } }` `
` `private static readonly string[] sequence = "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15".Split(','); static void Main(string[] args) { var every4thElement = sequence .Where((p, index) => index % 4 == 0); foreach (string p in every4thElement) { Console.WriteLine("{0}", p); } Console.ReadKey(); }` `