In C++, I can do this:
cout << "Line 1\nLine 2\n";
In Java, I can do this:
System.out.printf("Line 1%nLine 2%n");
In C#, do I really need to do one of these cumbersome things:
Console.WriteLine("Line 1");
Console.WriteLine("Line 2");
or
Console.Write("Line 1{0}Line 2{0}", Environment.NewLine);
or is there a more concise way, which is not platform-specific?
\nin C++ platform-agnostic? As far as I know that represents a linefeed character which is a valid Unix newline but not a complete Windows newline (it's\r\n), but I'm ignorant when it comes to C++.\r\ncould work, as\nis still part of it and will therefore be recognized as a newline on Unix systems.