C# two double quotes

前端 未结 11 1513
灰色年华
灰色年华 2020-12-10 03:54

I want to print two double quotes in C# as the output. How to do this?

I mean the output should be: \"\" Hello World \"\"

11条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 04:54

    Using a @-char before the 'normal' double quotes will result in printing every special char between those dubble quotes

    string foo = @"foo "bar"";
    

提交回复
热议问题