<div class="meta" robots="noindex">

</div>

Method

# Remove

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Arrays.RemoveAt<arrays.removeat>` as a replacement.

</div>

## Description

Removes an element from an array. Arrays are zero-based.

## Usage

*array*.**Remove** *index*

| Part  | Type                               | Description                                                        |
|-------|------------------------------------|--------------------------------------------------------------------|
| array | Any data type                      | Required. The array to remove the element from.                    |
| index | `Integer</api/data_types/integer>` | Required. The element number to be removed. Arrays are zero-based. |

## Notes

The <span class="title-ref">Remove</span> method removes the *index* element from the *array*. The resulting elements are shifted down to the removed element so that there are no gaps in the array.

The <span class="title-ref">Remove</span> method works with one-dimensional arrays only.

All arrays are indexed starting at position 0. Arrays can have a maximum index value of 2,147,483,646.

## Sample code

This example removes element 4 from the aNames array:

``` xojo
Dim names() As Text = Array("Bob", "Tom", "Jane")
names.Remove(1)
' names() = "Bob", "Jane"
```

## Compatibility

All project types on all supported operating systems.

## See also

`Dim</api/language/dim>` statement; `Array</api/language/array>`, `String<string.fromarray>`, `String<string.split>`, `Arrays<arrays.lastindex>` functions; `Arrays<arrays.add>`, `Arrays.IndexOf<arrays.indexof>`, `Arrays<arrays.addat>`, `Redim</api/language/redim>`, `Arrays.Pop<arrays.pop>`, `Shuffle</api/language/shuffle>`, `Sort<arrays.sort>`, `Arrays.Sortwith<arrays.sortwith>` methods; `ParamArray</api/language/paramarray>` keyword; `Arrays</api/language/arrays>` concept
