pad

From The K Language Wiki
Revision as of 07:47, 19 July 2021 by Razetime (talk | contribs) (add pad page)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Pad
x$y

Pad pads a string with spaces on one side to a specific length, based on an integer x.

Positive integers pad on the right, and negative integers pad on the left.

Padding is fully atomic, and special cased to treat strings as atoms.

  10$"abc"
"abc       "

  (3;4;(5;6))$("xy";"za";("bc";"cd"))
("xy "
 "za  "
 ("bc   "
  "cd    "))