added string functions

This commit is contained in:
2021-03-28 13:42:53 +02:00
parent 337fb2f80d
commit 89dd5c6f07
6 changed files with 45 additions and 8 deletions

View File

@@ -24,16 +24,17 @@
(defun string-trim (str)
(string-rltrim str " \n\r\t" "trim"))
; 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"))
(defun string-upcase (str)
(string-case str "upper"))
(defun string-downcase (str)
(string-case str "lower"))
; pause for interval
; pause for interval of seconds
(defun sleep (time)
(system-cmd (+ "sleep " (string time))))