({{, (RefLink[StringRiffle, paclet:ref/StringRiffle])[{(Subscript[s, 1]),(Subscript[s, 2]),(Subscript[s, 3]),…}]
creates a string by concatenating all the (Subscript[s, i]), with spaces inserted between them.}, {, (RefLink[StringRiffle, paclet:ref/StringRiffle])[{{(Subscript[s, 11]),(Subscript[s, 12]),…},{(Subscript[s, 21]),(Subscript[s, 22]),…},…}]
creates a string by concatenating the (Subscript[s, ij]), and inserting spaces at the lowest level and newlines at the higher level.}, {, (RefLink[StringRiffle, paclet:ref/StringRiffle])[list,sep]
inserts the separator sep between all elements in list.}, {, (RefLink[StringRiffle, paclet:ref/StringRiffle])[list,{"left","sep","right"}]
use left and right as delimiters after concatenation.}, {, (RefLink[StringRiffle, paclet:ref/StringRiffle])[list,(Subscript[sep, 1]),(Subscript[sep, 2]),…]
inserts separator (Subscript[sep, i]) between elements of list at level i.}})

OpenersNotesSection(Spacer1)Details

Any element of list that is not a string is converted to a string using (RefLink[TextString, paclet:ref/TextString]).

In (RefLink[StringRiffle, paclet:ref/StringRiffle])[list], spaces are used as separators at the lowest level. At the next level up, newlines are used. At each higher level, successively more newlines are used.

OpenersPrimaryExamplesSection(Spacer1)Examples  (7)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Insert spaces between successive elements:

StringRiffle[{"a", "b", "c", "d", "e"}]

Insert a specific string between elements:

StringRiffle[{"a", "b", "c", "d", "e"}, ", "]

Specify delimiters to use at the beginning and end of the result:

StringRiffle[{"a", "b", "c", "d", "e"},{"(", " ",")"}]

Using newlines and spaces as separators:

StringRiffle[{{"a","b","c"},{"d","e","f"}}]

Specify separators at each level:

StringRiffle[{{"a","b","c"},{"d","e","f"}}, "\n","\t"]

OpenersExampleSection1(Spacer1)Generalizations & Extensions  (1)

By default, higher-dimensional arrays use increasing numbers of newlines to separate levels:

StringRiffle @ RandomInteger[9,4]

StringRiffle @ RandomInteger[9,{3,4}]

StringRiffle @ RandomInteger[9,{2,3,4}]

OpenersExampleSection3(Spacer1)Applications  (3)

Convert the contents of a matrix to a string:

StringRiffle[RandomInteger[9,{8,8}]]

Convert a table to a string in a TSV (tab-separated values) format:

StringRiffle[{{1,"a",Yesterday}, {2,"b",Today},{3,"c",Tomorrow}},"\n","\t"]

Rewrite a list of key-value pairs into a JSON-like string:

StringRiffle[{{"a",27},{"b",28},{"c",29}}, {"{",", ","}"}, ": "]

OpenersExampleSection4(Spacer1)Properties & Relations  (1)

Values that are not strings are converted to strings using (RefLink[TextString, paclet:ref/TextString]):

StringRiffle[Range[10], ", "]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[StringJoin, paclet:ref/StringJoin])  ▪  (RefLink[StringTemplate, paclet:ref/StringTemplate])  ▪  (RefLink[Riffle, paclet:ref/Riffle])  ▪  (RefLink[Flatten, paclet:ref/Flatten])  ▪  (RefLink[StringInsert, paclet:ref/StringInsert])  ▪  (RefLink[StringExtract, paclet:ref/StringExtract])  ▪  (RefLink[ListFormat, paclet:ref/ListFormat])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[String Operations, paclet:guide/StringOperations])}, {▪(RefLinkPlain[Text Generation, paclet:guide/TextConstruction])}, {▪(RefLinkPlain[String Manipulation, paclet:guide/StringManipulation])}, {▪(RefLinkPlain[Text Manipulation, paclet:guide/ProcessingTextualData])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/42-string-patterns-and-templates.html])(WebLink[: String Patterns and Templates , https://www.wolfram.com/language/elementary-introduction/42-string-patterns-and-templates.html])}})}})