OxL Reference

method Set.len

The number of elements.

Example:

oxl✓ checked in CI
fn main() io {
  var s: Set<i32> = Set.new()
  s.insert(1)
  s.insert(1)
  print("{s.len()}")
}
Output
1

Number of elements.

Example:

oxl✓ checked in CI
fn main() io {
  var s = Set<i32>.new()
  s.insert(1)
  s.insert(1)
  print("{s.len()}")
}
Output
1
pub(api) fn len() -> usize

Complexity. O(1).

Since. 1.0.0-beta

Returns

usize

Effects

none declared (pure unless the body says otherwise)

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

See also