string pad/rpad/lpad

This commit is contained in:
2021-02-28 12:53:06 +01:00
parent 08b5053829
commit 46b29fc229
7 changed files with 49 additions and 28 deletions

View File

@@ -26,6 +26,16 @@
(defun inc (n) (+ n 1))
; pad string on the end
(defun string-rpad (str length pad_char)
(string-pad str length pad_char "rpad"))
; pad string on the begining
(defun string-lpad (str length pad_char)
(string-pad str length pad_char "lpad"))
; return second element of list
(defun second (l) (index l 1))