On the Windows platform, Environment.NewLine yields a carriage return AND a
line feed, so it wouldn't be equivalent to VB's Chr(13). It'd be equivalent
to vbCrLf.
As info to the OP, "\n" is a line feed (newline), so on Windows,
Environment.NewLine == "\r\n";
For just a carriage return, you would embed \r into the string, e.g.
'VB
string = "Foo" & Chr(13) & "Bar"
//C#
string s = "Foo\rBar";
//or
string s = String.Format("Foo{0}Bar","\r");
//or
string s = "Foo" + "\r" + "Bar";
--Bob
"firebalrog" <pa************@hotmail.com> wrote in message
news:11********************@g14g2000cwa.googlegrou ps.com...
Use the following.
System.Environment.NewLine
Jon Skeet [ C# MVP ] wrote: Alberto <al*****@nospam.com> wrote: > In a application in visual basic 6 I had chr$(13). How can I get the same > value in C#?
'\r' will do it...
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too