- (defun abc(_str / LM:lst->str LM:str->lst _alst _xlst )
- (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"
|