回复 阿赖耶识 的帖子
 - (defun Parse (str delim / lst pos)
- (setq pos (vl-string-search delim str))
- (while pos
- (setq lst (cons (substr str 1 pos) lst)
- str (substr str (+ pos 2))
- pos (vl-string-search delim str)
- )
- )
- (if (> (strlen str) 0)
- (setq lst (cons str lst))
- )
- (if (= " " delim) (setq lst (vl-remove "" lst)))
- (reverse lst)
- )
- ;测试
- (setq s (list 'a 'b 'c))
- (mapcar 'set s (parse "1,223,5667" ","))
|