How to create a multi-line string in C#

1 Answer

0 votes
using System;

namespace ConsoleApplication_C_Sharp
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = "c\n" +
                       "c++\n" +
                       "c#\n" +
                       "java\n" +
                       "python";

            Console.WriteLine(s);
        }
    }
}


/*
run:
       
c
c++
c#
java
python
   
*/

 



answered Jul 26, 2018 by avibootz

Related questions

1 answer 98 views
1 answer 142 views
1 answer 145 views
1 answer 232 views
232 views asked Jul 27, 2018 by avibootz
1 answer 148 views
148 views asked Jul 26, 2018 by avibootz
3 answers 260 views
260 views asked Oct 12, 2018 by avibootz
1 answer 115 views
...