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