OxL Reference

method List.len

Number of elements.

Example:

oxl✓ checked in CI
fn main() io {
  let xs: List<i32> = []
  print("{xs.isEmpty()} {[1].isEmpty()}")
}
Output
true false

Example:

oxl✓ checked in CI
fn main() io {
  let xs = [10, 20, 30]
  print("{xs.len()}")
}
Output
3
pub(api) fn len() -> usize

Since. 1.0.0-beta

Returns

usize

Effects

none declared (pure unless the body says otherwise)

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

See also