C# में Enviornment.NewLine का उपयोग नई लाइन जोड़ने के लिए किया जाता है।
शब्दों के बीच नई लाइन सेट करने के लिए:
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!