Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# @"" how do i insert a tab?

Tags:

c#

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 newline? is "" the only trick available? I tried search msdn but i couldnt find it.


1 Answers

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.

like image 56
John Gietzen Avatar answered Sep 09 '25 08:09

John Gietzen