CSharp - Write program to Create Preformatted Text

Requirements

You will create a program to display multiline text.

To display multiline text in one statement.

Hint

You prepend the opening quote mark of the text with the at (@) sign

Demo

using System;

class Program/*from  w  w w . j  av  a  2 s  .  com*/
{
    static void Main(string[] args)
    {
        Console.WriteLine(@" 
this is a test
test
test
another line of text
");

    }
}

Result

Note

The at (@) sign also switches off escape sequences.

It is useful when dealing with file paths in Windows. You do not have to double each backslash.