Frage

I have a list of characters (?h ?e ?l ?l ?o) and i want to convert it to string "hello". Currently i use this structure:

(concat (mapcar (lambda (ch) (char-to-string ch)) s))

Is there a more elegant and idiomatic way to convert list of chars to a string in Elisp?

War es hilfreich?

Lösung

Elisp's concat returns a string:

(concat '(?h ?e ?l ?l ?o))

(Found it out from coerce implementation in cl)

Andere Tipps

There's also (apply #'string LIST-OF-CHARS).

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top