Discuz! Board

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 2|回复: 0
打印 上一主题 下一主题

[C#]换行|Newline

[复制链接]

189

主题

189

帖子

580

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
580
跳转到指定楼层
楼主
发表于 2017-7-14 16:40:58 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[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";
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Comsenz Inc.  

GMT+8, 2026-10-26 05:55 , Processed in 0.282435 second(s), 22 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表