OxL Reference

method Group.count

Number of elements of the group (g.count() in group by … into g).

Example:

oxl✓ checked in CI
fn main() io {
  let words = ["apple", "avocado", "banana"]
  for r in from w in words group by w.slice(0, 1) into g select (g.key, g.count()) {
    print("{r}")
  }
}
Output
("a", 2)
("b", 1)
pub(api) fn count() -> usize

Complexity. O(1).

Since. 1.0.0-beta

Returns

usize

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:1040

See also