summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tissue/utils.scm8
1 files changed, 8 insertions, 0 deletions
diff --git a/tissue/utils.scm b/tissue/utils.scm
index 26372da..84bafa5 100644
--- a/tissue/utils.scm
+++ b/tissue/utils.scm
@@ -23,6 +23,7 @@
#:use-module (ice-9 filesystem)
#:use-module (ice-9 popen)
#:export (string-blank?
+ string-contains?
string-remove-prefix
string-remove-suffix
human-date-string
@@ -36,6 +37,13 @@
"Return #t if STR contains only whitespace. Else, return #f."
(string-every char-set:whitespace str))
+(define (string-contains? str1 str2)
+ "Return #t if STR1 contains STR2. Else, return #f. This is different
+from string-contains in that it does not return the index in STR1
+where STR2 occurs as a substring."
+ (and (string-contains str1 str2)
+ #t))
+
(define (string-remove-prefix prefix str)
"Remove PREFIX from STR."
(substring str (string-length prefix)))