;; | ---------------------------------------------------------------------------- ;; | ST_RepChar ;; | ---------------------------------------------------------------------------- ;; | Function : Replace one character in a string with another ;; | Argument : 'oldchar' - Old Character (source) ;; | 'newchar' - New Character (replace with) ;; | 'Str' - String to process ;; | Return : The string with the specified characters replaced ;; | Updated : February 5, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun ST_RepChar(oldchar newchar Str / len cnt nstr cchar) (setq len (strlen str) nstr "" cnt 1 ) (repeat len (setq cchar (substr str cnt 1) cnt (1+ cnt) ) (if (/= cchar oldchar) (setq nstr (strcat nstr cchar)) (setq nstr (strcat nstr newchar)) ) ) nstr )