(defun LM:lst->str ( lst del )
(if (cdr lst)
(strcat (car lst) del (LM:lst->str (cdr lst) del))
(car lst)
)
)
(defun LM:str->lst ( str del / pos )
(if (setq pos (vl-string-search del str))
(cons (substr str 1 pos) (LM:str->lst (substr str (+ pos 1 (strlen del))) del))
(list str)
)
)
(LM:lst->str
(apply 'append
(mapcar '(lambda(x)
(setq _alst nil)
(cond
((wcmatch x "*`**")
(setq _xlst (LM:str->lst x "*"))
((lambda(y z)(repeat (atoi z) (setq _alst (cons y _alst)))_alst)(car _xlst)(cadr _xlst))
)
(t (list x))
)
)(LM:str->lst _str " "))) " ")
)
命令: (abc "50 100*3 200*2 100*1")
"50 100 100 100 200 200 100"
黄翔 发表于 2024-8-19 00:41
命令: (abc "50 100*3 200*2 100*1")
"50 100 100 100 200 200 100"
感谢感谢感谢 xyp1964 发表于 2024-8-18 22:27
感谢,这个需要下载工具箱才能运行吧
页:
1
[2]