Here a public response to a question that today I have received.
On a piece of code of a C# DLL I wrote for a customer, there's a piece of
code where an email message is composed. The code is something like this:
sMessage="This is my mail
message"+Environment.NewLine+"....."
Now the question is: why the usage of Environment.NewLine instead of a
simple \n?
The answer is that on programs that must be portable to different
environments, using Environment.NewLine is the
best choice, because this instruction gets not a simple \n character but it gets the newline string
defined for the environment where you're on. Seems a bit strange but newline is
not always the same (for example on Windows platforms it's \r\n while on Unix platforms it's
simply \n).
A little curiosity to improve portability... 