zoukankan      html  css  js  c++  java
  • C#中的转义字符verbatim string

    In a verbatim string (a string starting with @"") to escape double quotes you use double quotes, e.g. @"Please press ""Ok"".". If you want to do it with verbatim strings then you would do something like @"""" (that's 3 double quotes on the end there).

    In verbatim string literals (@"...") a " in the string value is encoded as "", which happens to also be the only escape sequence in verbatim strings.

    @"""Happy coding!"""     // => "Happy coding!"
    
    "\"Happy coding!\""    // => "Happy coding!"

    Note that in the 2nd case (not a verbatim string literal), a is required before the and the " to escape them and prevent their normal meanings.

    See the C# string reference for more details and examples.

    单纯的字符串的话,直接加进行转义。但是在@开头的字符串中,使用""来表示"

  • 相关阅读:
    jquery 初篇
    python作用域和js作用域的比较
    javascript作用域
    第三篇、dom操作续
    dom事件
    第二篇 dom内容操作之value
    第三篇、变量
    第二篇、常量
    Node.js
    测试用例
  • 原文地址:https://www.cnblogs.com/chucklu/p/10270739.html
Copyright © 2011-2022 走看看