I intend to apply the split-string
function to the following string
"\ghjky\dfsgi\45fdj\854f"
using the character "\"
as a separator in order to get the list ("ghjky" "dfsgi" "45fdj" "854f")
.
I could use the following function
(split-string "\ghjky\dfsgi\45fdj\854f" "\" t)
;; return: forward-sexp: Scan error: "Unbalanced parentheses"
but it does not work, as the separator is not recognized
Then I try
(split-string "\ghjky\dfsgi\45fdj\854f" "\\" t)
;; return: split-string: Invalid regexp: "Trailing backslash"
but it still doesn't work
(split-string "\ghjky\dfsgi\45fdj\854f" "\\\\" t)
;; ("Ghjky^?fsgi%fdj854f")
Other attempts:
(defun split-now (astr)
(interactive "sEnter a string: ")
(split-string astr "\\\\" t))
(split-now "th\jki\fgt\y")
;; return: ("thjki^Lgty")
What is the correct procedure?