命令: (get-numbers-side-of-x "200X300")
("200" "300")
命令: (get-numbers-side-of-x "ab200X300cd")
("200" "300")
命令:
命令: (get-numbers-side-of-x "ab200X300")
("200" "300")
命令: (get-numbers-side-of-x "ab200x300")
("200" "300")
命令: (get-numbers-side-of-x "ab200x500")
("200" "500")
命令: (get-numbers-side-of-x "ab20.0x50.0")
("20.0" "50.0")
- (defun get-numbers-side-of-x (str)
- (setq lst (mapcar 'strcase (string:auto-split str)))
- (if
- (and
- (member "X" lst)
- (> (setq pos (vl-position "X" lst)) 0)
- (string:numberp (nth (1- pos) lst))
- (string:numberp (nth (1+ pos) lst))
- )
- (list (nth (1- pos) lst) (nth (1+ pos) lst))
- )
- )
|