fn repeat
Infinite sequence of copies of x.
Example:
fn main() io {
print("{repeat("ab").take(3).collect()}")
}Output
["ab", "ab", "ab"]
pub(api) fn repeat<T>(x: T) -> iter<T>Complexity. O(1) to build; each pull copies `x`.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
x | T |
Returns
iter<T>
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:76