Verbatim string literals v escape sequences

后端 未结 3 2069
半阙折子戏
半阙折子戏 2020-12-01 23:59

Is there any difference in how the C# compiler or .NET run-time handles verbatim string literals versus using escape sequences (i.e. performance) or is it just a matter of d

3条回答
  •  时光说笑
    2020-12-02 00:28

    The @ sign in front of a string tells the compiler to ignore any embeded escape sequences.

    string "\"" would yield a single double quote. string "\" would yield a single back slash string @"\" would yield two backslashes

提交回复
热议问题