[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: string to list

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...)