格式
typescript
List.Swap(rhs)所属类: List
描述
将当前列表中的元素与指定列表进行互换。
参数
| 参数名 | 类型 | 描述 |
|---|---|---|
| rhs | List<T> | 指定列表 |
返回值
| 类型 | 描述 |
|---|---|
void |
代码示例
typescript
let list = new List<Number>(Number);
list.AddRange([100, 200, 300]);
let otherList = new List<Number>(Number);
otherList.AddRange([100, 10]);
//将 list 和 otherList 列表中的元素互换
list.Swap(otherList);