[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: string to list
- To: firstname.lastname@example.org
- Subject: Re: string to list
- From: Malcolm Pradhan <email@example.com>
- Date: 12 Feb 1994 06:24:13 GMT
- Distribution: world
- Newsgroups: comp.lang.lisp.mcl
- Organization: Section of Medical Informatics, Stanford University
- References: <firstname.lastname@example.org>
In article <email@example.com> Youngcook Jun,
>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?
(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...)