Share via


Collections.Swap(IList<Object>, Int32, Int32) Method

Definition

Swaps the elements at the specified positions in the specified list.

[Android.Runtime.Register("swap", "(Ljava/util/List;II)V", "")]
public static void Swap (System.Collections.Generic.IList<object> list, int i, int j);
[<Android.Runtime.Register("swap", "(Ljava/util/List;II)V", "")>]
static member Swap : System.Collections.Generic.IList<obj> * int * int -> unit

Parameters

list
IList<Object>

The list in which to swap elements.

i
Int32

the index of one element to be swapped.

j
Int32

the index of the other element to be swapped.

Attributes

Remarks

Swaps the elements at the specified positions in the specified list. (If the specified positions are equal, invoking this method leaves the list unchanged.)

Added in 1.4.

Java documentation for java.util.Collections.swap(java.util.List<?>, int, int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to