Environment constants

空扰寡人 提交于 2019-11-30 16:34:53

问题


Is there an equivalant to Environment.NewLine in DotNet for a Tab character?


回答1:


NewLine is on the Environment class because the new line specification varies between platforms:

It's "\r\n" for non-Unix platforms and "\n" for Unix platforms. However tab is always "\t".




回答2:


Short answer is: no, tab does not change between platforms as newline might, so there is no need for one.

Long answer is: technically, yes, you could use the one provided by VB in the Microsoft.VisualBasic.dll. I think it's Microsoft.VisualBasic.Constants.vbTab, but there's no good reason to use it in C# as I said above.



来源:https://stackoverflow.com/questions/294939/environment-constants

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!