Re: converting a string to a list
- From: Bata <bataboo66@xxxxxxxx>
- Date: Sat, 01 Aug 2009 10:32:11 -0400
David Greene wrote:
"ccc31807" <cartercc@xxxxxxxxx> wrote in messageUse (cl-ppcre:split " " string-name) to get a list of the different
news:389503e4-eb6a-48c2-af76-cebe1dc7141c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In CL, if you have a list which you can then turn into a string like
this:
(setf my-list '(this is a list)) ;make a listIn Perl, if I wanted to go the other way, I'd write:
(setf my-string (write-to-string my-list)) ;convert the list to
a string
my $str = 'This is a string'; #make a stringHow do you convert a string to a list in CL? Is there a CL equivalent
my $list = split $str; #convert the string to a list
to Perl's split() function, or Java's StringTokenizer class?
Thanks, CC.
words in the string.
Check out the cl-ppcre package's functionality, its quite amazing.
.
- Follow-Ups:
- Re: converting a string to a list
- From: w_a_x_man
- Re: converting a string to a list
- Prev by Date: Re: CLOS address superclass constructor (lisp newbie)
- Next by Date: Re: (cos 100000000000000000000000000000000) returns 0.0 in sbcl
- Previous by thread: http://www.voguetouch.com cheaper g-satr Kidrobot hoodies ed hardy star red monkey gino green global True Religion ED-hardy Kidrobot jeans hoodies ***ier ***r exporters, manufacture
- Next by thread: Re: converting a string to a list
- Index(es):