Search Chirayu Software Solutions Blog

Saturday, September 28, 2013

NewLine in C#

Program that uses Environment.NewLine: C#

using System;

class Program
{
    static void Main()
    {
 //
 // Use string concat to combine two literals
 // with the newline constant.
 //
 string s = "First line" +
     Environment.NewLine +
     "Second line";
 Console.Write(s);
 Console.Read();
    }
}

Output

First line
Second line
Post a Comment