Mythran <ki********@hotmail.comREMOVETRAIL> wrote:
In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.
Environment.NewLine
No - there's a subtle difference there. Environment.NewLine won't
always give you carriage-return-line-feed which I would certainly hope
that vbCrLf will. Instead, it gives you the default newline for the
current system - which on windows is \r\n, but not on some other
platforms (where you might be running Mono or Rotor).
It's always worth making sure you know exactly which one you actually
want - if you're writing text files, Environment.NewLine is probably
correct. If you're dealing with a network protocol which specifies the
line terminator, you should use that.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog:
http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too