Rotates a list and returns the rotated list, without changing the source list.
Namespace: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic static IEnumerable<T> Rotate<T>(
IList<T> source,
int amountToRotate
)
public:
generic<typename T>
static IEnumerable<T>^ Rotate(
IList<T>^ source,
int amountToRotate
)
Parameters
- source
- Type: System.Collections.GenericIListT
The list to rotate. - amountToRotate
- Type: SystemInt32
The number of elements to rotate. This value can be positive or negative.
For example, rotating by positive 3 means that source[3] is the first item in the returned collection.
Rotating by negative 3 means that source[source.Count - 3] is the first item in the returned collection.
Type Parameters
- T
[Missing <typeparam name="T"/> documentation for "M:X3Platform.Collections.Algorithms.Rotate``1(System.Collections.Generic.IList{``0},System.Int32)"]
Return Value
Type:
IEnumerableTA collection that contains the items from
source in rotated order.
Exceptions
See Also