chickadee » srfi-152 » string-pad-right

(string-pad string len [char start end]) → stringprocedure
(string-pad-right string len [char start end]) → stringprocedure

Returns a string of length len comprised of the characters drawn from the given subrange of string, padded on the left (right) by as many occurrences of the character char as needed. If string has more than len chars, it is truncated on the left (right) to length len. char defaults to #\space.

(string-pad "325" 5) ⇒ "  325"
(string-pad "71325" 5) ⇒ "71325"
(string-pad "8871325" 5) ⇒ "71325"