OxL Reference

method Map.remove

Removes the entry for k and returns its value, or none when there was none.

Example:

oxl✓ checked in CI
fn main() io {
  var m: Map<str, i32> = {"a": 1}
  print("{m.remove("a")} {m.remove("a")}")
}
Output
1 none

Removes k and returns its value, or none.

Example:

oxl✓ checked in CI
fn main() io {
  var m: Map<str, i32> = {"a": 1}
  print("{m.remove("a")} {m.remove("a")}")
}
Output
1 none
pub(api) var fn remove(k: K) -> V?

Complexity. O(1) on average.

Since. 1.0.0-beta

Parameters

NameType
kK

Returns

V?

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/collections.oxl:798

See also