remove

Summary

Removes the array element at the specified index.

Signatures

Click on a signature to select it and view its documentation.

Usage

public void remove(int index)

Parameters

index

The index of the element to remove.

Description

Removes the array element at the specified index.

This method mutates the array.

Examples

Basic Usage
1
2
3
4
5
import System;
 
int[] arr = [ 1, 2, 3 ];
arr.remove(1);
Console.log(arr.toString()); // "1,3"
Remove each array element individually
1
2
3
4
5
6
7
import System;
 
int[] arr = [ 1, 2, 3 ];
for(int i = arr.length; i >= 0; --i) {
    arr.remove(i);
}
Console.log(arr.toString()); // ""

Share

HTML | BBCode | Direct Link