CSharp examples for System.Collections.Generic:IEnumerable
Rotate element from IEnumerable
using System.Linq; using System.Collections.Generic; using System;//from ww w . j a v a 2s . c om public class Main{ public static IEnumerable<T> Rotate<T>(this IEnumerable<T> enumerable, int elementCount) { foreach (var element in enumerable.Skip(elementCount)) { yield return element; } foreach (var element in enumerable.Take(elementCount)) { yield return element; } } }