(defun list-to-string(lst / x l)
(foreach x lst
(setq l (cons (vl-string-left-trim "(" (vl-string-right-trim ")" (vl-princ-to-string x))) l)))
(reverse l)
)
; _$ (setq aaa '((王超军 26) (张云 13) (李四 35) (赵富贵 72) (张伟 36)) )
; ((王超军 26) (张云 13) (李四 35) (赵富贵 72) (张伟 36))
; _$ (LIST-TO-STRING aaa)
; ("王超军 26" "张云 13" "李四 35" "赵富贵 72" "张伟 36") (mapcar '(lambda (x) (substr (setq str (vl-princ-to-string x)) 2 (1- (strlen str)))) l) (defun abc (lst / a) (mapcar '(lambda (x) (setq a (vl-princ-to-string x))(substr a 2 (- (strlen a) 2))) lst)) vl-princ-to-string 不错的资料,谢谢分享。
页:
[1]