diff options
author | Ben Sima <ben@bsima.me> | 2020-05-12 21:48:14 -0700 |
---|---|---|
committer | Ben Sima <ben@bsima.me> | 2020-05-12 21:48:14 -0700 |
commit | 282762a3b12d24c3b3cec8db7e9a103245926d36 (patch) | |
tree | c4279e928265e07113b25ebc23ed1ffe50cb1012 /Alpha/String.scm | |
parent | 1ff73c7c6b1c0e30c6076663f6b771f9b5bd9009 (diff) |
Add strip and flatten
Diffstat (limited to 'Alpha/String.scm')
-rw-r--r-- | Alpha/String.scm | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Alpha/String.scm b/Alpha/String.scm index 4e32856..6e29663 100644 --- a/Alpha/String.scm +++ b/Alpha/String.scm @@ -1,5 +1,6 @@ (define-module (Alpha String) - #:export (replace replace-char to-string str capitalize split)) + #:export (replace replace-char to-string str capitalize split + strip lstrip rstrip)) (define (split s c) (if s @@ -31,6 +32,15 @@ (str (string-upcase (substring s 0 1)) (substring s 1 ))))) +(define (strip s char) + (string-trim-both s char)) + +(define (lstrip s char) + (string-trim s char)) + +(define (rstrip s char) + (string-trim-right s char )) + ;;; {String Fun: string-replace-substring} ;;; |