X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=strings.lisp;h=028d97870c2fa4aacc96f5955f9fa1cabed95e8f;hp=7e9be34ce521f95c1a6c335a120b64dc10f6f7ef;hb=298d0534004c26eb5a6881ea34658f59e180b63b;hpb=123adbaf1fb442ffff615c56e118bfd374f02b9f diff --git a/strings.lisp b/strings.lisp index 7e9be34..028d978 100644 --- a/strings.lisp +++ b/strings.lisp @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Apr 2000 ;;;; -;;;; $Id: strings.lisp,v 1.16 2003/04/30 02:16:21 kevin Exp $ +;;;; $Id: strings.lisp,v 1.17 2003/05/04 14:52:10 kevin Exp $ ;;;; ;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -59,6 +59,16 @@ do (setf start (1+ end)))) +(defun ndelimited-string-to-list (sequence &optional (separator #\space)) + "Split a string by a delimitor" + (loop + with start = 0 + for end = (position separator sequence :start start) + collect (nsubseq sequence start end) + until (null end) + do + (setf start (1+ end)))) + #+excl (defun list-to-delimited-string (list &optional (separator #\space)) (excl:list-to-delimited-string list separator))