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.

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

  • 相关阅读:
    Go语言基础--1.1 变量的声明
    基本语法
    弹性盒子修改
    弹性盒子内容
    弹性盒子
    响应式列重置
    栅格系统
    布局容器
    额外按钮
    可消失的弹出框
  • 原文地址:https://www.cnblogs.com/chucklu/p/10270739.html
Copyright © 2011-2022 走看看