Hi,
It's a little too late, but I had some routine doing the same thing
(str2lst "a b c" " ") -> ("a" "b" "c")
(str2lst "1,2,3" ",") -> ("1" "2" "3")
(mapcar 'read (str2lst "1,2,3" ",")) -> (1 2 3)
(defun str2lst (str sep / pos)
(if (setq pos (vl-string-position (ascii sep) str))
(cons (substr str 1 pos)
(str2lst (substr str (+ 2 pos)) sep)
)
(list str)
)
)
and the opposite function
(lst2str '(1 2 3) ",") -> "1,2,3"
(lst2str '("a" "b" "c") " ") -> "a b c"
(defun lst2str (lst sep)
(if (cadr lst)
(strcat (vl-princ-to-string (car lst))
sep
(lst2str (cdr lst) sep)
)
(vl-princ-to-string (car lst))
)
)