StringForm does not create a string. As StringForm["x=``", 1] // FullForm will show you, it stays unevaluated. But it is shown in a special way in the notebook (i.e. the `` replaced by 1).
You can create a plain string from it using
ToString[ StringForm["x=``", 1] ]
which will give
"x=1"
Unfortunately, when we need to build strings, this does not always work perfectly:
ToString[ StringForm["x=``", 1/2] ]
1
x=-
2
This gave the result as a three-line string, in OutputForm. We can try ToString[ StringForm["x=``", 1/2], InputForm ], but it'll return "StringForm[\"x=``\", 1/2]" (unformatted). We can also try ToString[ StringForm["x=``", 1/2], StandardForm], but the result will be a string containing box expressions (as you noticed). These special expressions can contain information about formatting (everything from font styles to two-dimensional math such as $\frac{1}{2}$), but they can only be shown in a Mathematica notebook. They are not human readable and cannot be used by other programs.
To get the desired "x=1/2", the workaround is
ToString@StringForm["x=``", InputForm[1/2]]
Recap:
StringForm does not change the expressions passed to it at all. StringForm expressions are merely displayed specially in notebooks.
How StringForm is displayed depends on the output format set (OutputForm, StandardForm, TraditionalForm, etc.)
Use ToString to obtain an actual string.
Attributes[StringForm]– Mr.Wizard♦ Feb 20 '12 at 10:14Attributes[StringForm]gives{Protected}(version 8.4). – kguler Feb 20 '12 at 10:16