c# - "\n"和 Environment.NewLine 的区别

标签 c# .net cross-platform

两者之间有什么区别(如果有的话)(相对于 .Net)?

最佳答案

取决于平台。在 Windows 上,它实际上是“\r\n”。

来自 MSDN:

A string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms.

关于c# - "\n"和 Environment.NewLine 的区别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1015766/

相关文章:

c++ - 以编程方式获取主机的 DNS 服务器

c# - 使用 C# 和 Google.Apis.YouTube.v3 列出 YouTube 视频

c# - 按类的字符串字段对列表进行排序

c# - AssemblyBuilder.SetCustomAttribute 中字节数组的用途是什么

c# - 为什么接口(interface)不能有静态成员方法

c# - 如何使用 html agility pack 解析一个简单的页面?

c# - 如何停止动画WPF?

c# - 停用后执行 Windows Phone 8.1 应用程序

windows - 跨平台 Emacs 脚本

.net - 使用构建后脚本在 MonoDevelop 和 Visual Studio 上运行的项目的最佳方式?