From 23bb0633f248a708b6e218528aa60819e8c80196 Mon Sep 17 00:00:00 2001 From: Ray Miller Date: Fri, 27 Jun 2025 11:01:40 +0000 Subject: [PATCH] Add string utility functions --- anarres/strings.scm | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 anarres/strings.scm diff --git a/anarres/strings.scm b/anarres/strings.scm new file mode 100644 index 0000000..582eb79 --- /dev/null +++ b/anarres/strings.scm @@ -0,0 +1,11 @@ +(define-module (anarres strings)) + +(define-public (string-remove-prefix prefix s) + (if (string-prefix? prefix s) + (string-drop s (string-length prefix)) + s)) + +(define-public (string-remove-suffix suffix s) + (if (string-suffix? suffix s) + (string-drop-right s (string-length suffix)) + s))