scm: Add string-delete.

* module/srfi/srfi-13.mes (string-delete): New function.
This commit is contained in:
Jan Nieuwenhuizen 2017-01-17 18:48:28 +01:00
parent 6ffca4bf61
commit 5fae0f7bff

View file

@ -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)))))