Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

Converting between Expressions & Strings

Expressions in the Wolfram Language can be represented as strings in a variety of ways, for display, export, or processing. The Wolfram Language provides powerful functions for formatting expressions as strings, and for parsing strings to determine the expressions they represent.


ToString convert any expression to a string

ToExpression convert a string to an expression

TextString give a human-readable string version of an expression, eliding as needed

Format Types »

InputForm  ▪  OutputForm  ▪  StandardForm  ▪  TraditionalForm  ▪  TeXForm  ▪  DisplayForm  ▪  ...

SyntaxQ, SyntaxLength test syntactic correctness of input strings

ImportString import strings in many file and other formats to give expressions

ExportString export expressions to give many formats of strings

StringFormat  ▪  Hash

Interpreter define how a string should be interpreted

SemanticInterpretation interpret a string semantically with a particular target

SemanticImportString interpret a string semantically as a structured dataset

Special Conversions

IntegerString convert an integer to a string

DateList, DateString convert between string and list forms of dates

Symbol, SymbolName convert between strings and symbols

SpokenString convert to a spoken representation of an expression

LetterNumber, FromLetterNumber convert a to 1, b to 2, etc.