({{, (RefLink[StringForm, paclet:ref/StringForm])["controlstring",(Subscript[expr, 1]),…]
prints as the text of the controlstring, with the printed forms of the (Subscript[expr, i]) embedded. }})

OpenersNotesSection(Spacer1)Details

`i` in the control string indicates a point at which to print (Subscript[expr, i]).

`` includes the next (Subscript[expr, i]) not yet printed.

`.` prints a raw ` in the output string. »

You can use (RefLink[StringForm, paclet:ref/StringForm]) to set up "formatted output".

Messages given as values for objects of the form s::t are used as control strings for (RefLink[StringForm, paclet:ref/StringForm]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (9)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Insert a single value into a string:

StringForm["The value of x is ``.",5]

Insert a sequence of values into a string:

StringForm["The values are x=`` and y=``.",5,10]

Insert indexed values:

StringForm["The values are x=`2` and y=`1`.",10,5]

OpenersExampleSection1(Spacer1)Scope  (4)

Embed a symbolic result:

StringForm["The integral result is ``.",Integrate[x,x]]

Embed an unevaluated symbolic expression:

StringForm["The integral is ``.",HoldForm[Integrate[x,x]]]

Include an explicit ` character in a string:

StringForm["The symbol `` is defined in the Global`.` context.",x]

Insert any number of expressions into a string:

StringForm["``  ``  ``  ``  ``",e1,e2,e3,e4,e5]

Expressions can be inserted in the output string more than once:

StringForm["{`1`,`2`,`1`,`1`,`2`}",e1,e2]

OpenersExampleSection2(Spacer1)Properties & Relations  (1)

(RefLink[StringForm, paclet:ref/StringForm]) prints as a string with items inserted as output:

s::t="A string with inputs `1` and `2`.";

StringForm[s::t,e1,e2]

(RefLink[Message, paclet:ref/Message]) prints a string with items inserted:

Message[s::t,e1,e2]

(RefLink[StringInsert, paclet:ref/StringInsert]) inserts a string into a string:

StringInsert[StringInsert["A string with inputs  and .","e1",-7],"e2",-2]

OpenersExampleSection3(Spacer1)Possible Issues  (1)

There should be enough items to fill the placeholders in the control string:

StringForm["A string with inputs `1` and `2`.",e1]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Row, paclet:ref/Row])  ▪  (RefLink[StringJoin, paclet:ref/StringJoin])  ▪  (RefLink[ToString, paclet:ref/ToString])  ▪  (RefLink[Message, paclet:ref/Message])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[String-Oriented Output Formats, paclet:tutorial/StringOrientedOutputFormats])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Textual Elements in Notebooks, paclet:guide/TextualElementsInNotebooks])}, {▪(RefLinkPlain[String Manipulation, paclet:guide/StringManipulation])}})}})