by @saigowthamr

How to create a multiline string in C#

Home » c sharp » How to create a multiline string in C#

To create a multiline string in C#, we can use the @ symbol in front of a string.

Here is an example:

// literal

using System;

class Demo {
  static void Main() {

      string str = @"You can,
        see me in
        Multiple lines";

    Console.WriteLine(str);
  }
}

Output:

You can,
        see me in
        Multiple lines