The Representation of Textual Forms

Like everything else in the Wolfram System, the textual forms of expressions can themselves be represented as expressions. Textual forms that consist of one-dimensional sequences of characters can be represented directly as ordinary Wolfram System strings. Textual forms that involve subscripts, superscripts, and other two-dimensional constructs, however, can be represented by nested collections of two-dimensional boxes.

Typical representations of textual forms.

This generates the string corresponding to the textual representation of the expression in (RefLink[InputForm, paclet:ref/InputForm]):

ToString[x^2+y^3,InputForm]

(RefLink[FullForm, paclet:ref/FullForm]) shows the string explicitly:

FullForm[%]

Here are the individual characters in the string:

Characters[%]

Here is the box structure corresponding to the expression in (RefLink[StandardForm, paclet:ref/StandardForm]):

ToBoxes[x^2+y^3,StandardForm]

Here is the (RefLink[InputForm, paclet:ref/InputForm]) of the box structure. In this form the structure is effectively represented by an ordinary string:

ToBoxes[x^2+y^3,StandardForm]//InputForm

If you use the notebook front end for the Wolfram System, then you can see the expression that corresponds to the textual form of each cell by using the (MenuGrayLink[Show Expression, paclet:ref/menuitem/ShowExpression]) menu item.

Here is a cell containing an expression in (RefLink[StandardForm, paclet:ref/StandardForm]).

Here is the underlying representation of that expression in terms of boxes, displayed using the (MenuGrayLink[Show Expression, paclet:ref/menuitem/ShowExpression]) menu item.

Creating strings and boxes from expressions.