I ran into this problem in 2009. I submitted it to WRI technical support. This is the reply I received.
After going through your notebook, I believe that what you observed is the
expected behavior of ToString. To elaborate:
When you use ToString[form], ToString prints out the string in the
OutputForm. Further this function to put everything sequentially and
therefore does not recognize that ALL the strings after \n should be placed
in a different line. Rather it just puts the string directly associated
with \n\n two spaces down and then resumes printing the later strings in
the same line.
The simplest way that you can remedy this issue is to use
both these options retain the original intended format.
Following this advice will give output that looks the way you want, but it may not be what you really want because it is not a simple string, but an interpretation box.
str = ToString[
StringForm["SomeText='`1`'\nas well as OtherText='`2`'.", "textA", "textB"],
as well as OtherText='textB'.
str // FullForm
After receiving tech support's reply, I thought I might work around this by using
Row instead of
StringForm, but that didn't work. It gives the same output as you got with
StringForm because, as the tech support reply implies, the problem lies in how
ToString works and not with
If you really want a simple string, I'm afraid you will have use Mathematica's string manipulation tools to build the string from component parts.