StringForm

StringForm["controlstring",expr1,]

prints as the text of the controlstring, with the printed forms of the expri embedded.

Details

  • `i` in the control string indicates a point at which to print expri.
  • `` includes the next expri not yet printed.
  • `.` prints a raw ` in the output string. »
  • You can use StringForm to set up "formatted output".
  • Messages given as values for objects of the form s::t are used as control strings for StringForm.

Examples

open allclose all

Basic Examples  (3)

Insert a single value into a string:

Insert a sequence of values into a string:

Insert indexed values:

Scope  (4)

Embed a symbolic result:

Embed an unevaluated symbolic expression:

Include an explicit ` character in a string:

Insert any number of expressions into a string:

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

Properties & Relations  (1)

StringForm prints as a string with items inserted as output:

Message prints a string with items inserted:

StringInsert inserts a string into a string:

Possible Issues  (1)

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

Wolfram Research (1988), StringForm, Wolfram Language function, https://reference.wolfram.com/language/ref/StringForm.html (updated 2003).

Text

Wolfram Research (1988), StringForm, Wolfram Language function, https://reference.wolfram.com/language/ref/StringForm.html (updated 2003).

CMS

Wolfram Language. 1988. "StringForm." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2003. https://reference.wolfram.com/language/ref/StringForm.html.

APA

Wolfram Language. (1988). StringForm. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StringForm.html

BibTeX

@misc{reference.wolfram_2023_stringform, author="Wolfram Research", title="{StringForm}", year="2003", howpublished="\url{https://reference.wolfram.com/language/ref/StringForm.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_stringform, organization={Wolfram Research}, title={StringForm}, year={2003}, url={https://reference.wolfram.com/language/ref/StringForm.html}, note=[Accessed: 19-March-2024 ]}