C# @“” how do i insert a tab?

后端 未结 12 1260
南笙
南笙 2021-01-17 08:02

Recently i found out i can write in a \" by writing two \" ex @\"abc\"\"def\". I find the @ string literal useful. But how do i write in a tab or n

12条回答
  •  灰色年华
    2021-01-17 08:24

    When you are using the @ modifier, you are using something called a verbatim string literal.

    What this means is that anything you put in between the Opening and closing quotes will be used in the string.

    This includes Carraige Return, Line Feed, Tab and etc.

    Short answer: Just press tab.

    One caveat, though. Your IDE may decide to insert spaces instead of a tab character, so you may be better off using concatenation.

提交回复
热议问题