method List.len
Number of elements.
Example:
fn main() io {
let xs: List<i32> = []
print("{xs.isEmpty()} {[1].isEmpty()}")
}Output
true false
Example:
fn main() io {
let xs = [10, 20, 30]
print("{xs.len()}")
}Output
3
pub(api) fn len() -> usizeSince. 1.0.0-beta
Returns
usize
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:55