[cl-ppcre-devel] omitting initial void string in split returns

Noldus Reijnders n_reijnders at hotmail.com
Fri Apr 13 12:03:53 UTC 2012


How about using (string-trim " " " 43 76 87 33 89 ") first and then doing split?
See http://cl-cookbook.sourceforge.net/strings.html#trim 
Noldus
> From: edi at agharta.de
> Date: Fri, 13 Apr 2012 13:58:27 +0200
> To: cl-ppcre-devel at common-lisp.net
> Subject: Re: [cl-ppcre-devel] omitting initial void string in split returns
> 
> I don't think there is (unless you want the initial space to be a part
> of the first string like "  43").  The easiest solution would be to
> call something like REMOVE-IF or DELETE-IF directly afterwards.
> 
> Cheers,
> Edi.
> 
> On Fri, Apr 13, 2012 at 12:03 PM, Mario Maio <mario.maio at libero.it> wrote:
> > I want to parse strings of space-separated integers, and split is perfect
> > except when I have vertical aligned integers. In such cases I've got one or
> > more spaces at beginning of string, and the resulting list has a void string
> > as 1st element:
> >
> > CL-USER> (cl-ppcre:split "\\s+" "   43  76  87  33   89  ")
> >
> > ("" "43" "76" "87" "33" "89")
> >
> > Is there an option to avoid such initial void string?
> >
> > Thanks.
> >
> > Mario
> >
> >
> > _______________________________________________
> > cl-ppcre-devel site list
> > cl-ppcre-devel at common-lisp.net
> > http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
> >
> 
> _______________________________________________
> cl-ppcre-devel site list
> cl-ppcre-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/cl-ppcre-devel
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/cl-ppcre-devel/attachments/20120413/363752ae/attachment.html>


More information about the Cl-ppcre-devel mailing list