Skip to content

format

typescript
List.Swap(rhs)

class: List

description

Swaps the elements in the current list with the elements in the specified list.

parameter

param_nametypedescription
rhsList<T>The specified list.

reture

typedescription
void

code example

typescript
let list = new List<Number>(Number);
list.AddRange([100, 200, 300]);
        
let otherList = new List<Number>(Number);
otherList.AddRange([100, 10]);
// Swap the elements in list and otherList
list.Swap(otherList);