method str.padStart
Pads on the left with fill up to width characters.
Example:
fn main() io {
print("7".padStart(3, '0'))
}Output
007
pub(api) fn padStart(width: usize, fill: char = ' ') -> strSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
width | usize |
fill | char = ' ' |
Returns
str
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/text.oxl:700