Hello Michael,
ahh, damn, almost forgot, it's old trick.
when u read from the resources, you lost your escape sequece. u need to restore
it. changing \\r on \r
the following code fix it
string str = Properties.Resources.MsgHelloWorld;
str = str.Replace("\\n", "\n");
str = str.Replace("\\r", "\r");
---
WBR,
Michael Nemtsev [.NET/C# MVP] :: blog:
http://spaces.live.com/laflour
"The greatest danger for most of us is not that our aim is too high and we
miss it, but that it is too low and we reach it" (c) Michelangelo
MNHello Peter,
MN>
MNhmmmmm, interesting.
MNseems that smth wrong with the text encoding. need to investigate
MN---
MNWBR,
MNMichael Nemtsev [.NET/C# MVP] :: blog:
MN
http://spaces.live.com/laflour
MN"The greatest danger for most of us is not that our aim is too high
MNand we miss it, but that it is too low and we reach it" (c)
MNMichelangelo
MN>
>>Why not just read it into the string
Properties.Resources.<your_resourceand then add the new lines ?
PH>Hmm, I'm not sure I follow...
PH>>
PH>I have a resource file with the following tag and text:
PH>MsgHelloWorld "Hello\r\nWorld"
PH>>
PH>I then retrieve the resource with a resource manager like this:
PH>resMan = new ResourceManager( ... )
PH>string msg = resMan.GetString("MsgHelloWorld");
PH>MessageBox.Show(msg);
PH>This will print "Hello\r\nWorld", but I want it to print:
PH>"Hello
PH>World"
PH>How did you mean I could solve this?
PH>/ Peter
PH>>
>>PHI understand that the\n and \r only means something to the C#
PHcompiler so when retrieving a line like "Hello\r\nWorld" from a
PHresource file (localized form or self made resource file), it
prints
PHthe text as just like it was written.
PHPHIs there any easy way to introduce a newline (tab etc.) into
a
PHstring retrieved from a resource file? Or should I create a
resource
PHstring for each line?
PHPHThanks,
PHPHPeter
PH>