method Map.contains
Whether the map has an entry for k.
Example:
fn main() io {
let m = {"a": 1}
print("{m.contains("a")} {m.contains("b")}")
}Output
true false
True when the map has an entry for k.
Example:
fn main() io {
let m: Map<str, i32> = {"a": 1}
print("{m.contains("a")} {m.contains("b")}")
}Output
true false
pub(api) fn contains(k: K) -> boolComplexity. O(1) on average.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
k | K |
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:825