pad

align string by adding given padding


Parameters

pad string :string :literal
    padding :integer

Attributes

centeradd padding to both sides
rightadd right padding
with:charpad with given character

Returns

  • :string

Examples

copy
pad "good" 10 ; => " good" pad.right "good" 10 ; => "good " pad.center "good" 10 ; => " good "

copy
a: "hello" pad 'a 10 ; a: " hello"

copy
pad.with:`0` to :string 123 5 ; => 00123

Related