c# - Can I escape a double quote in a verbatim string literal? -


in verbatim string literal (@"foo") in c#, backslashes aren't treated escapes, doing \" double quote doesn't work. there way double quote in verbatim string literal?

this understandably doesn't work:

string foo = @"this \"word\" escaped"; 

use duplicated double quote.

@"this ""word"" escaped"; 

outputs:

this "word" escaped 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -

What is happening when Matlab is starting a "parallel pool"? -