< ><FONT face=宋体>(defun replstr (old new str)
(setq nstr "")
(repeat (strlen str)
(if (= (substr str 1 1) old)
(setq nstr (strcat nstr new))
(setq nstr (strcat nstr (substr str 1 1)))
)
(setq str (substr str 2))
)
nstr
)</FONT></P>
<P><FONT face=宋体></FONT> </P>
<P>你使用R14的话就不好用下面的了</P>
<P><FONT face=宋体>(defun ea:repstr (new old str)
(vl-list->string
(subst (ascii new) (ascii old) (vl-string->list str))
)
)</FONT></P> |