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

Viewed 21768

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.

13 Answers

I don't know why nobody suggested nowaday to insert {"\t"} in your interpolation string, to me it's better than having to use string format.

this works: $@"Foo{"\t"}Bar"; or concatenating strings

Try this

var mystr = $@"before tab {"\t"} after tab";
Related