Suppose I have the following code:
string myFormat = "Line1/nLine 2";
string formattedString = string.Format(m yFormat);
....that would produce a 2-line output as expected.
But if I load that very same format string from an xml file:
....load xmlNode WorkNode...
string myFormat= WorkNode.Attrib utes["text"].InnerText.ToSt ring();
string formattedString = string.Format(m yFormat);
....the result is a one-line "Line1/nLine 2" output.
How can I get the string.Format method to handle control characters correctly?
string myFormat = "Line1/nLine 2";
string formattedString = string.Format(m yFormat);
....that would produce a 2-line output as expected.
But if I load that very same format string from an xml file:
....load xmlNode WorkNode...
string myFormat= WorkNode.Attrib utes["text"].InnerText.ToSt ring();
string formattedString = string.Format(m yFormat);
....the result is a one-line "Line1/nLine 2" output.
How can I get the string.Format method to handle control characters correctly?
Comment