Environment constants

前端 未结 2 1259
执笔经年
执笔经年 2021-01-04 00:07

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

相关标签:
2条回答
  • 2021-01-04 00:54

    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".

    0 讨论(0)
  • 2021-01-04 00:55

    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.

    0 讨论(0)
提交回复
热议问题