Enviornment.NewLine C# में नई लाइन जोड़ने के लिए प्रयोग किया जाता है।
शब्दों के बीच एक नई लाइन सेट करने के लिए -
str = "This is demo text!" + Environment.NewLine + "This is demo text on next line!";
निम्नलिखित कोड है -
उदाहरण
using System;
using System.IO;
namespace Demo {
class Program {
static void Main(string[] args) {
string str = "This is demo text!" + Environment.NewLine + "This is demo text on next line!";
Console.Write(str);
}
}
} आउटपुट
This is demo text! This is demo text on next line!