({{, (RefLink[ExportString, paclet:ref/ExportString])[expr,"format"]
generates a string corresponding to expr exported in the specified format. }, {, (RefLink[ExportString, paclet:ref/ExportString])[rules,{"format","Rules"}]
gives explicit rules for different elements of the data to be exported. }, {, (RefLink[ExportString, paclet:ref/ExportString])[exprs,elems]
generates a string by treating exprs as elements specified by elems.}})

OpenersNotesSection(Spacer1)Details

(RefLink[ExportString, paclet:ref/ExportString]) handles a large number of formats, each typically with many different possible elements. The possible formats are given in the list (RefLink[$ExportFormats, paclet:ref/$ExportFormats]), and in the "Listing of All Formats".

(RefLink[ExportString, paclet:ref/ExportString]) works just like (RefLink[Export, paclet:ref/Export]), with the same element specifications and options.

Many graphics, sound, and binary formats yield strings containing non-printable characters.

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (3)

Export in MathML format:

ExportString[x+y,"MathML"]

Show explicitly as a string:

InputForm[%]

Export a graphic in SVG format:

ExportString[Graphics[Disk[]],"SVG"]

Many formats give strings containing non-printable characters:

ExportString[Graphics[Disk[],ImageSize->10],"GIF"]//InputForm

FullForm[%]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[ImportString, paclet:ref/ImportString])  ▪  (RefLink[Export, paclet:ref/Export])  ▪  (RefLink[ExportByteArray, paclet:ref/ExportByteArray])  ▪  (RefLink[Rasterize, paclet:ref/Rasterize])  ▪  (RefLink[BaseEncode, paclet:ref/BaseEncode])  ▪  (RefLink[Compress, paclet:ref/Compress])  ▪  (RefLink[FunctionCompileExportString, paclet:ref/FunctionCompileExportString])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Importing and Exporting Data, paclet:tutorial/ImportingAndExportingData])}, {▪(RefLinkPlain[Importing Graphics and Sounds, paclet:tutorial/ImportingGraphicsAndSounds])}, {▪(RefLinkPlain[Exporting Graphics and Sounds, paclet:tutorial/ExportingGraphicsAndSounds])}, {▪(RefLinkPlain[Importing and Exporting Files, paclet:tutorial/ImportingAndExportingFiles])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Importing and Exporting, paclet:guide/ImportingAndExporting])}, {▪(RefLinkPlain[Converting between Expressions & Strings, paclet:guide/ConvertingBetweenExpressionsAndStrings])}, {▪(RefLinkPlain[String Manipulation, paclet:guide/StringManipulation])}, {▪(RefLinkPlain[String Operations, paclet:guide/StringOperations])}, {▪(RefLinkPlain[XML Formats, paclet:guide/XMLFormats])}, {▪(RefLinkPlain[Network Programming, paclet:guide/NetworkProgramming])}, {▪(RefLinkPlain[Importing & Exporting Database Formats, paclet:guide/ImportingAndExportingDatabaseFormats])}, {▪(RefLinkPlain[Character Operations, paclet:guide/CharacterOperations])}, {▪(RefLinkPlain[External Interpreted Language Interfaces, paclet:guide/ExternalInterpretedLanguageInterfaces])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/44-importing-and-exporting.html])(WebLink[: Importing and Exporting, https://www.wolfram.com/language/elementary-introduction/44-importing-and-exporting.html])}})}})