C#中的Environment.NewLine
C#中的Enviornment.NewLine用于添加换行符。
在单词之间设置新行-
str = "这是演示文字!" + 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 = "这是演示文字!" + Environment.NewLine + "This is demo text on next line!";
Console.Write(str);
}
}
}输出结果
这是演示文字! This is demo text on next line!
热门推荐
10 烟台疫情祝福语简短英语
11 发给家人祝福语简短英文
12 新店开业祝福语贺词简短
13 订婚祝福语活泼精辟简短
14 上级转岗祝福语大全简短
15 有关诗词的祝福语简短
16 温暖文艺简短祝福语短句
17 祝福语送超市同事简短
18 同事护士退休祝福语简短