[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string to list
- To: info-mcl@ministry.cambridge.apple.com
- Subject: Re: string to list
- From: Malcolm Pradhan <pradhan@camis.stanford.edu>
- Date: 12 Feb 1994 06:24:13 GMT
- Distribution: world
- Newsgroups: comp.lang.lisp.mcl
- Organization: Section of Medical Informatics, Stanford University
- References: <2jhklt$bdv@vixen.cso.uiuc.edu>
In article <2jhklt$bdv@vixen.cso.uiuc.edu> Youngcook Jun,
yjun@symcom.math.uiuc.edu writes:
>Can anybody help me how to convert a string to a list?
>For example, how can I make "How are you?" in the form of (How are you?)
>and vise versa?
How about:
(read-from-string (concatenate 'string "(" "How are you" ")"))
to get (how are you), and:
(string-trim '(#\( #\)) (prin1-to-string '(how are you)))
to get "how are you".
Of course this assumes that you don't have any parentheses in your strings
(you could substitute them for another char if you liked this method...)
Regards,
Malcolm