G
Guest
Hi, friends,
In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.
In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.
"\r\n"Andrew said:Hi, friends,
In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.
Andrew said:Hi, friends,
In VB, there is a vbCrLf for a new line. What is the counterpart in C#?
Thanks.
Steve said:"\n"
or "\r"
or sometimes I have seen both "\r\n"
Mythran said:Environment.NewLine
Jon Skeet said: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.