







[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Rotates a list or array in place.
Namespace: Wintellect.PowerCollections
Assembly:
PowerCollections (in PowerCollections.dll)
Syntax
| C# |
|---|
public static void RotateInPlace<T>( IList<T> list, int amountToRotate ) |
| Visual Basic (Declaration) |
|---|
Public Shared Sub RotateInPlace(Of T) ( _ list As IList(Of T), _ amountToRotate As Integer _ ) |
| Visual C++ |
|---|
public: generic<typename T> static void RotateInPlace ( IList<T>^ list, int amountToRotate ) |
Parameters
- list
- IList<(Of <T>)>
The list or array to rotate.
- amountToRotate
- Int32
The number of elements to rotate. This value can be positive or negative. For example, rotating by positive 3 means that list[3] is the first item in the resulting list. Rotating by negative 3 means that list[list.Count - 3] is the first item in the resulting list.
Type Parameters
- T
Remarks
Although arrays cast to IList<T> are normally read-only, this method
will work correctly and modify an array passed as list.
Exceptions
| Exception | Condition |
|---|---|
| System..::ArgumentNullException | list is null. |
See Also
Algorithms Class
Wintellect.PowerCollections Namespace
