Skip to content

Modern Array Remove

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Array › Array Container › Remove

Remove

Removes the element at a position, keeping the rest in order.

Syntax

Remove( byval i as int32 )

Notes

  • O(n) — preserves order

Examples

#import "std/containers"
using containers

dim v as Array( of ustring )
v.Push( "a" ) : v.Push( "b" ) : v.Push( "c" )

v.Remove( 1 )            '' order-preserving, O(n)
print v[ 0 ] & v[ 1 ]    '' ac
print v.Count            '' 2

'' An out-of-range index is a no-op, not an error
v.Remove( 99 )
print v.Count            '' 2

Library: Array Container
Category: Array
Documented under: Members

Clone this wiki locally