summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2022-06-26 11:00:35 +0530
committerArun Isaac2022-06-27 00:19:50 +0530
commit162f6b4a4c933f49428f8d41ad308dc6e7a9b4d2 (patch)
tree995a885e73698bae6341419c01b595f1464a9933
parent6d2eed6253295702a7a44c6f7d62fec8bc005cd8 (diff)
downloadtissue-162f6b4a4c933f49428f8d41ad308dc6e7a9b4d2.tar.gz
tissue-162f6b4a4c933f49428f8d41ad308dc6e7a9b4d2.tar.lz
tissue-162f6b4a4c933f49428f8d41ad308dc6e7a9b4d2.zip
utils: Add string-remove-prefix.
* tissue/utils.scm (string-remove-prefix): New public 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 4f865be..c3b3e3a 100644
--- a/tissue/utils.scm
+++ b/tissue/utils.scm
@@ -20,10 +20,15 @@
#:use-module (rnrs io ports)
#:use-module (srfi srfi-26)
#:use-module (ice-9 popen)
- #:export (call-with-current-directory
+ #:export (string-remove-prefix
+ call-with-current-directory
get-line-dos-or-unix
memoize-thunk))
+(define (string-remove-prefix prefix str)
+ "Remove PREFIX from STR."
+ (substring str (string-length prefix)))
+
(define (call-with-current-directory curdir thunk)
"Call THUNK with current directory set to CURDIR. Restore current
directory after THUNK returns."