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 -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -