public static void RotateValues <T>(this IIndexable <T> array, int times) { times %= array.Length; if (times == 0) { return; } if (times < 0) { times = array.Length + times; } var values = array .Concat(array) .Skip(array.Length - times) .Take(array.Length) .ToList(); values.WriteToArray(array); }