I have a string, declared as:
string text = \"THIS IS LINE ONE \"+(Char)(13)+\" this is line 2\";
And yet, When I write Console.WriteLin
"A carriage return, sometimes known as a cartridge return and often shortened to CR, or return, is a control character or mechanism used to reset a device's position to the beginning of a line of text." (source)
CR
never changes a line, in fact it returns all the way to the beginning of "THIS IS LINE ONE "
and prints " this is line 2"
on top of it, hence why you see the additional E
at the end of the sentence, as line one is one character longer. This is made clearer if you remove the two spaces from the two strings (last character of first string and first character of second string) where the output then becomes "this is line 2NE"
.
From the same source:
"It commands a printer, or other output system such as a display, to move the position of the cursor to the first position on the same line."
What you're looking for is not CR
, but a combination of CR
and LF
(line feed): CRLF