Is there a function to concatenate elements of a list with a separator?
For example:
> foobar " " ["is","there","such","a","function","?"]
["is there such a function ?"]
Thanks for any reply!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, there is:
intersperseis a bit more general:Also, for the specific case where you want to join with a space character, there is
unwords:unlinesworks similarly, only that the strings are imploded using the newline character and that a newline character is also added to the end. (This makes it useful for serializing text files, which must per POSIX standard end with a trailing newline)