summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-07-13 02:55:16 +0530
committerArun Isaac2022-07-13 02:55:16 +0530
commit553aed8550292f6bbceca0fab684c37b4affa273 (patch)
treea42dd9adb51325484087bd7b9b87bf83053c113b
parent43fa0d994241bf9b7f547c5bbc923cd3984247c2 (diff)
downloadtissue-553aed8550292f6bbceca0fab684c37b4affa273.tar.gz
tissue-553aed8550292f6bbceca0fab684c37b4affa273.tar.lz
tissue-553aed8550292f6bbceca0fab684c37b4affa273.zip
utils: Add string-blank? utility.
* tissue/utils.scm (string-blank?): New function.
-rw-r--r--tissue/utils.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/tissue/utils.scm b/tissue/utils.scm
index b90e708..26372da 100644
--- a/tissue/utils.scm
+++ b/tissue/utils.scm
@@ -22,7 +22,8 @@
#:use-module (srfi srfi-26)
#:use-module (ice-9 filesystem)
#:use-module (ice-9 popen)
- #:export (string-remove-prefix
+ #:export (string-blank?
+ string-remove-prefix
string-remove-suffix
human-date-string
call-with-current-directory
@@ -31,6 +32,10 @@
get-line-dos-or-unix
memoize-thunk))
+(define (string-blank? str)
+ "Return #t if STR contains only whitespace. Else, return #f."
+ (string-every char-set:whitespace str))
+
(define (string-remove-prefix prefix str)
"Remove PREFIX from STR."
(substring str (string-length prefix)))