C# 字符串多行显示、文本换行

以textbox为例

        ①:先设置textbox的属性Multiline为true

        ②:组织好显示字符串:FistLine(第一行要显示的字符)、SecondLine(第二行要显示的字符)、。。。。。。。、第n行字符

        ③:textbox.text="FistLine"+System.Environment.NewLine+"SecondLine"+System.Environment.NewLine+。。。。+"第N 行"+System.Environment.NewLine

   当你看到上面代码的时候可能会认为我们一般用的换行符不是" "吗

  你会想到这种方式:textbox.text="FistLine"+“ ”+"SecondLine"+" "+。。。。+"第N 行"+" "

 这种格式可能在运行时也不会出错,但在Linux操作系统或其他系统可能就会出错

原文地址:https://www.cnblogs.com/kuangwong/p/8675023.html