Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

40,026 questions

51,982 answers

573 users

How to use Environment.NewLine in C#

2 Answers

0 votes
using System;

class Program
{
    static void Main() {
        Console.WriteLine($"Line 1 {Environment.NewLine}Line 2 {Environment.NewLine}Line 3");
    }
}




/*
run:

Line 1 
Line 2 
Line 3

*/

 



answered Nov 18, 2023 by avibootz
0 votes
using System;

class Program
{
    static void Main() {
        string str = $"Line 1 {Environment.NewLine}Line 2 {Environment.NewLine}Line 3";
        
        Console.WriteLine(str);
    }
}




/*
run:

Line 1 
Line 2 
Line 3

*/

 



answered Nov 18, 2023 by avibootz

Related questions

1 answer 138 views
138 views asked Jan 13, 2017 by avibootz
2 answers 152 views
152 views asked Jan 13, 2017 by avibootz
1 answer 125 views
125 views asked May 30, 2023 by avibootz
1 answer 162 views
162 views asked Jan 16, 2017 by avibootz
2 answers 122 views
1 answer 148 views
2 answers 150 views
150 views asked May 4, 2021 by avibootz
...