Discuz! Board

标题: [C#]换行|Newline [打印本页]

作者: Jerry小坏    时间: 2017-7-14 16:40
标题: [C#]换行|Newline
[CN]通常我们都是用\n来进行文本换行,但这样的换行输出到记事本中是看不到的,所以最好的方法是:

[EN]
Usually when we want to add a newline we will write "\n", but the newline by this way is invisible in Notepad, therefore, use the function below instead of "\n".
  1. Environment.NewLine
复制代码



For example:
  1. private readonly string mywebsite = "ESFKAMI\nwww.esfkami.net";
复制代码




  1. private readonly string mywebsite = "ESFKAMI" + Environment.NewLine + "www.esfkami.net";
复制代码








欢迎光临 Discuz! Board (https://esfbbs.foxnyx.top/) Powered by Discuz! X3.2