Looking for a replace-in-string function in elisp
s.el
string manipulation library has s-replace
function:
(s-replace "." "bar" "foo.buzz") ;; => "foobarbuzz"
I recommend installing s.el
from Emacs package manager, if you work with strings in your Elisp.
Try this:
(defun replace-in-string (what with in)
(replace-regexp-in-string (regexp-quote what) with in nil 'literal))