OxL Reference

method str.padStart

Pads on the left with fill up to width characters.

Example:

oxl✓ checked in CI
fn main() io {
  print("7".padStart(3, '0'))
}
Output
007
pub(api) fn padStart(width: usize, fill: char = ' ') -> str

Since. 1.0.0-beta

Parameters

NameType
widthusize
fillchar = ' '

Returns

str

Effects

none declared (pure unless the body says otherwise)

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

See also