Emacs Lisp中是否有一个功能与split-string
相反,即将列表的元素连接到由给定分隔符分隔的字符串中?换句话说,是否有给定列表的功能,例如("foo" "bar" "baz")
和定界符,例如", "
,以该分隔符分隔的字符串形式返回该列表,例如"foo, bar, baz"
。
Common Lisp seems to have such a function,但在Emacs Lisp中具有相同名称的函数 format
是完全不同的函数。
最佳答案
我认为您正在寻找mapconcat:
mapconcat
applies function to each element of sequence: the results, which must be strings, are concatenated. Between each pair of result strings,mapconcat
inserts the string separator. Usually separator contains a space or comma or other suitable punctuation.
关于elisp - 是否有将字符串连接成定界字符串的函数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12999530/