Next: strcmp

Prev: match_template

pad

pad(string, length)
pad(string, length, filler)
This function pads or truncates string to the length length. If filler is specified, then it must be a single-character string to use as the filler character; otherwise, a space is used. If length is greater than the length of string, then pad adds filler characters on the right; however, you can force pad to add filler on the left by specifying length as a negative number.

Examples:

pad("foo", 6)
     => "foo   "
pad("foobar", 3)
     => "foo"
pad(tostr(29), -4, "0")
     => "0029"