Add string utility functions
This commit is contained in:
parent
58b85e4f5e
commit
23bb0633f2
1 changed files with 11 additions and 0 deletions
11
anarres/strings.scm
Normal file
11
anarres/strings.scm
Normal file
|
@ -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))
|
Loading…
Add table
Add a link
Reference in a new issue