How to append a new line character in c#

Madhu.b.rokkam
Posted by Madhu.b.rokkam under C# category on | Points: 40 | Views : 2826
Environment.NewLine or "\n"
adds a new line charater in c#

string str1 = "Dotnetfunda is best.";
string str2 = "I am part of it";
Console.Write(str1 + Environment.NewLine + str2);


or

string str1 = "Dotnetfunda is best.";
string str2 = "I am part of it";
Console.Write(str1 + "\n" + str2);



output
Dotnetfunda is best.
I am part of it

Comments or Responses

Login to post response