init Set.new
True when the set has no elements.
Example:
fn main() io {
print("{Set<i32>.new().isEmpty()}")
}Output
true
Number of elements.
Example:
fn main() io {
var s = Set<i32>.new()
s.insert(1)
s.insert(1)
print("{s.len()}")
}Output
1
An empty set.
Example:
fn main() io {
let s = Set<i32>.new()
print("{s.len()}")
}Output
0
pub(api) init new() -> SelfSince. 1.0.0-beta
Returns
Self
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:949