;; | ---------------------------------------------------------------------------- ;; | ST_lsrch ;; | ---------------------------------------------------------------------------- ;; | Function : Search for the last occurence of a character in a string ;; | Argument : 'str' - String to search ;; | 'delim' - Character to search ;; | Return : The numeric last position from start where the specified character ;; | occurs ;; | Updated : February 5, 1999 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ---------------------------------------------------------------------------- (defun ST_lsrch(str delim / len pos cnt ch) (setq len (strlen str) pos nil ) (if (> len 0) (progn (setq cnt 1) (while (<= cnt len) (setq ch (substr str 1 1) str (substr str 2) ) (if (= ch delim) (setq pos cnt) ) (setq cnt (1+ cnt)) ) )) pos )