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
Post a Comment