Get the newline string defined for this environment in CSharp

Description

The following code shows how to get the newline string defined for this environment.

Example


/*  w w w . j  a  va  2 s. c o  m*/
using System;

class Sample 
{
    public static void Main() 
    {
        Console.WriteLine("NewLine: {0}  first line{0}  second line{0}  third line",
                          Environment.NewLine);
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Development »




Console
Encoding
Environment
Random