Emacs Redux

Return to the Essence of Text Editing

Converting Between Symbols and Strings

| Comments

Sometimes you might need to convert a symbol to string (or vice versa) in Emacs Lisp. You start looking for functions like symbol-to-string and string-to-symbol but, alas, they do not seem exist. Do not despair! Such functions do actually exist, although their names are likely to surprise you:

1
2
3
4
(symbol-name 'some-symbol)
; => "some-symbol"
(intern "some-symbol")
; => some-symbol

Comments