Add string-take, string-drop.

* module/srfi/srfi-13.mes (string-take, string-drop): New functions.
This commit is contained in:
Jan Nieuwenhuizen 2017-01-04 20:56:47 +01:00
parent c3a6d70f74
commit a0baa98196

View file

@ -52,3 +52,9 @@
(loop (cdr rest) (loop (cdr rest)
(append result (append result
(list (list->string (list-head lst (- (length lst) (length rest))))))))))) (list (list->string (list-head lst (- (length lst) (length rest)))))))))))
(define (string-take s n)
(list->string (list-head (string->list s) n)))
(define (string-drop s n)
(list->string (list-tail (string->list s) n)))