C# printing a new line
To print a new line within the message while printing it on the console, we can use following methods,
- Using \n – prints new line
- Using \x0A or \xA (ASCII literal of \n) – prints new line
- Console.WriteLine() – prints new line, if we write any message in the method – it will print new line after the message, if we do not write any message – it will print a new line only.
-
C# code to print new line
In the below example – we are printing new lines between the messages or/and after the message.
Output