method str.repeat
The text repeated n times.
Example:
fn main() io {
print("ab".repeat(3))
}Output
ababab
The string repeated n times.
Example:
fn main() io {
print("ab".repeat(3))
}Output
ababab
pub(api) fn repeat(n: usize) -> strComplexity. O(n * len).
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
n | usize |
Returns
str
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:578