method List.clear
Removes all elements.
Example:
fn main() io {
var xs = [1, 2, 3]
xs.clear()
print("{xs.len()}")
}Output
0
Removes all elements.
Example:
fn main() io {
var xs = [1, 2, 3]
xs.clear()
print("{xs.len()}")
}Output
0
pub(api) var fn clear()Complexity. O(n).
Since. 1.0.0-beta
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/collections.oxl:270