Skip to content

Modern Map Remove

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

Home › Map › Map › Remove

Remove

Removes a key and its value; returns true if the key was there.

Syntax

Remove( k ) as boolean

Examples

#import "std/containers"
using containers

dim ages as Map( of ustring, integer )
ages.Put( "ada", 36 )
ages.Put( "grace", 45 )

print ages.Remove( "ada" )       '' true -- something was removed
print ages.Remove( "ada" )       '' false -- already gone
print ages.Count                 '' 1

'' The slot becomes a TOMBSTONE rather than empty, so a probe chain
'' through it still finds what lies beyond

Library: Map
Category: Map
Documented under: Members

Clone this wiki locally