(defun get_front(a / b c k np) (setq b (strlen a)) (setq k 1) (setq c "") (while b (setq d (substr a k 1)) (if (numberp (read d)) ; ³Ñ°Ü¹ÞÀº ¹®ÀÚ°¡ ¼ýÀÚÀÎÁö ÆÇ´Ü. (setq b nil) (setq c (strcat c d)) ) (setq k (1+ k)) ) (setq b_last (substr a (1- k))) (if (setq np (vl-string-position (ascii "-") b_last)) (setq b_last (strcat (substr b_last 1 np) "." (substr b_last (+ np 2)))) ) (setq b_last (rtos (atof b_last) 2 2)) ; ¼ýÀںκÐÀ» ½Ç¼ö·Î ¹Ù²Ù°í ´Ù½Ã ¹®ÀÚ·Î º¯È¯ dimzin ÂüÁ¶. c ) ; c ´Â ¾ÕºÎºÐÀÇ ¿µ¹®ÀÚ¸¸ ¸®ÅÏ. ; b_last´Â µÞºÎºÐÀÇ ¼ýÀÚ¸¦ "-"À» "."À¸·Î ¹Ù²Ù¾î¼ º¯¼ö¿¡ ÁöÁ¤. ; ex) (get_front "WA3-05") -> "WA" ¸®ÅÏÇÏ°í b_last¿¡ "3.05"ÀúÀåÇÔ. |