- (defun str2lst (str / st nstr i)
- (setq nstr "" i 0)
- (repeat (strlen str)
- (if (or (wcmatch (setq st (substr str (setq i (1+ i)) 1)) "#")(= st "."))
- (setq nstr (strcat nstr st))
- (if (and (/= "" nstr)(/= " " (substr nstr (strlen nstr))))(setq nstr (strcat nstr " ")))
- )
- )
- (read (strcat "(" nstr")"))
- )
- ;|测试
- (setq str (list "23, 45, 1.023" "meflying18.8" "meflyin18.8¥g18。18.5$8.8$$$1。8"))
- (mapcar '(lambda(x)(str2lst x)) str)
- ->((23 45 1.023) (18.8) (18.8 18 18.5 8.8 1 8))
- |;
|