I have a list:

lis = {{"abc","def","ghi"},{"jkl","mno"}}

and wish to get:

res = {"abc def ghi","jkl mno"}


Table[StringJoin[lis[[i]]], {i, Length[lis]}]

doesn't produce the desired " " between the original elements in lis. As always, thanks for suggestions!


2 Answers 2


You can use StringRiffle:

StringRiffle /@ lis

{"abc def ghi", "jkl mno"}


Use Riffle

lis = {{"abc", "def", "ghi"}, {"jkl", "mno"}};

StringJoin[Riffle[#, " "]] & /@ lis

(* {"abc def ghi", "jkl mno"} *)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.