OxL Reference

method str.repeat

The text repeated n times.

Example:

oxl✓ checked in CI
fn main() io {
  print("ab".repeat(3))
}
Output
ababab

The string repeated n times.

Example:

oxl✓ checked in CI
fn main() io {
  print("ab".repeat(3))
}
Output
ababab
pub(api) fn repeat(n: usize) -> str

Complexity. O(n * len).

Since. 1.0.0-beta

Parameters

NameType
nusize

Returns

str

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/text.oxl:578

See also