string pad/rpad/lpad
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user