Aug 09 2006
I would agree that it is good to go with the use of Environment.NewLine as it adds an extra layer of platform independance, i.e. you don’t need to worry about whether to use \r\n or just \n, and you don’t need to worry so much about what happens when you port the code from one .Net language to another. It isn’t however the answer to all problems.
Environment.NewLine only answers the problem of new line on the machine that it is running on. Where you may still run into problem is when you create a file using Environment.NewLine and then move the file to another platform. This is an age old problem and I don’t have a solution for it, just that you should be under no illusion that Environment.NewLine will solve this problem.