Swap two elements of an array
Namespace: Stemmer.Cvb.Collections.Generic
Assembly: Stemmer.Cvb (in Stemmer.Cvb.dll) Version: 14.0.0.0
Syntax
Parameters
- arr
- Type: TValue
the array to attach the extension method to - index1
- Type: SystemInt32
element one to swap - index2
- Type: SystemInt32
element two to swap
Type Parameters
- TValue
- type of the elements stored in the array
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type . When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).Exceptions
Exception | Condition |
---|---|
ArgumentOutOfRangeException | If index1 or index2 is either less than 0 or greater than the length of the array |
See Also