method Map.remove
Removes the entry for k and returns its value, or none when there was none.
Example:
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:
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
| Name | Type |
|---|---|
k | K |
Returns
V?
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:798