Function: dired-replace-in-string

dired-replace-in-string is a byte-compiled function defined in dired.el.gz.

This function is obsolete since 28.1; use replace-regexp-in-string instead.

Signature

(dired-replace-in-string REGEXP NEWTEXT STRING)

Source Code

;; Defined in /usr/src/emacs/lisp/dired.el.gz
(defun dired-replace-in-string (regexp newtext string)
  ;; Replace REGEXP with NEWTEXT everywhere in STRING and return result.
  ;; NEWTEXT is taken literally---no \\DIGIT escapes will be recognized.
  (declare (obsolete replace-regexp-in-string "28.1"))
  (let ((result "") (start 0) mb me)
    (while (string-match regexp string start)
      (setq mb (match-beginning 0)
	    me (match-end 0)
	    result (concat result (substring string start mb) newtext)
	    start me))
    (concat result (substring string start))))