;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Str2lst - string to list
;Takes two string arguments. A delimiter or token and the main string.
;Returns a list of sub-strings from the main string.
;(setq b "人之初" c "之"),(str2lst b c)返回("之");(str2lst c b)返回("人" "初")
(defun str2lst ( a b / n c lst lst2 leng)
(setq lst (strsea a b)
n 0
);setq
(if lst
(progn
(setq c (substr b
1
(-
(nth 0 lst)
1
);minus
);substr
);setq
(setq lst2 (append lst2 (list c)));setq
(repeat (- (length lst) 1)
(setq leng (-
(nth (+ n 1) lst)
(nth n lst)
(strlen a)
);minus
c (substr b
(+
(nth n lst)
(strlen a)
);plus
leng
);substr
);setq
(setq lst2 (append lst2 (list c)));setq
(setq n (+ 1 n));setq
);repeat
(setq c (substr b
(+
(nth n lst)
(strlen a)
);plus
);substr
);setq
(setq lst2 (append lst2 (list c)));setq
);progn then
(setq lst2 (append lst2 (list b)));setq else
);if