method Set.contains
Whether x is in the set.
Example:
fn main() io {
var s: Set<i32> = Set.new()
s.insert(5)
print("{s.contains(5)} {s.contains(6)}")
}Output
true false
True when x is in the set.
Example:
fn main() io {
var s = Set<i32>.new()
s.insert(5)
print("{s.contains(5)} {s.contains(6)}")
}Output
true false
pub(api) fn contains(x: T) -> boolComplexity. O(1) on average.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
x | T |
Returns
bool
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:1103