std-string-xxx-pad-char | ![]() |
They justify a string to the left or right, so that the resulting string is exactly len characters long.
STD-STRING-LEFT-PAD-CHAR
adds the fill character at the end.
STD-STRING-RIGHT-PAD-CHAR
adds the fill character at the beginning.
Simplier justifiers like strfil can be implemented as
(defun strfil (s len) (std-string-right-pad-char s len " "))
which is the same as (str-rpad s len)
(std-string-left-pad-char (rtos 1.0) 6 " ") => "1.0 " (std-string-right-pad-char (rtos 1.0) 6 "-") => "---1.0" (std-string-left-pad-char "0001" 3 " ") => "000" (std-string-right-pad-char "1000" 3 " ") => "100"
str: a string.
len: a positive integer number.
fill-char: a string with one character. If more only the first is taken as fill character.
A string.
None.
(std-require 'STDSTR)
Defined in STDSTR