先用 string-replace
,有需要再用 regexp
(replace-regexp-in-string "\\\\" "/" "c:/tmp\\file.txt")
;; => "c:/tmp/file.txt"
(string-replace "\\" "/" "c:/tmp\\file.txt")
;; => "c:/tmp/file.txt"
先用 string-replace
,有需要再用 regexp
(replace-regexp-in-string "\\\\" "/" "c:/tmp\\file.txt")
;; => "c:/tmp/file.txt"
(string-replace "\\" "/" "c:/tmp\\file.txt")
;; => "c:/tmp/file.txt"