How to break long string into lines in C#

1 Answer

0 votes
using System;

class Program
{
    static void Main() {
        string s = "Line 1\n" +
                   "Line 2\n" +
                   "Line 3\n" +
                   "Line 4";

        Console.Write(s);
    }
}



/*
run:

Line 1
Line 2
Line 3
Line 4

*/

 



answered Sep 4, 2019 by avibootz

Related questions

1 answer 183 views
2 answers 161 views
1 answer 136 views
3 answers 312 views
...