From 5fae0f7bff5ea478808adb8feb696296f13c49fe Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Tue, 17 Jan 2017 18:48:28 +0100 Subject: [PATCH] scm: Add string-delete. * module/srfi/srfi-13.mes (string-delete): New function. --- module/srfi/srfi-13.mes | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/module/srfi/srfi-13.mes b/module/srfi/srfi-13.mes index c4e34c46..caf31a00 100644 --- a/module/srfi/srfi-13.mes +++ b/module/srfi/srfi-13.mes @@ -58,3 +58,8 @@ (define (string-drop s n) (list->string (list-tail (string->list s) n))) + +(define (string-delete pred s) + (let ((p (if (procedure? pred) pred + (lambda (c) (not (eq? pred c)))))) + (list->string (filter p (string->list s)))))