ExportString Listing of Formats »

ExportString[expr,"format"]
generates a string corresponding to expr exported in the specified format.

ExportString[rules,{"format","Rules"}]
gives explicit rules for different elements of the data to be exported.

ExportString[exprs,elems]
generates a string by treating exprs as elements specified by elems.

DetailsDetails

  • ExportString handles a large number of formats, each typically with many different possible elements. The possible formats are given in the list $ExportFormats, and in the "Listing of All Formats".
  • ExportString works just like Export, with the same element specifications and options.
  • Many graphics, sound, and binary formats yield strings containing nonprintable characters.

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Export in MathML format:

In[1]:=
Click for copyable input
Out[1]=

Show explicitly as a string:

Export a graphic in SVG format:

In[1]:=
Click for copyable input
Out[1]=

Many formats give strings containing non-printable characters:

In[2]:=
Click for copyable input
Out[2]//FullForm=
Introduced in 1999
(4.0)
| Updated in 2007
(6.0)