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.

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

最新文章

  1. [深入学习Web安全](5)详解MySQL注射
  2. thinkphp3.2!Go for it!
  3. java JFrame窗体真正关闭
  4. MySql的count统计结果
  5. Docker私有仓库Registry的搭建验证
  6. java jdbc----mysql的select、insert、update、delete
  7. hdu 1381 Crazy Search
  8. 特性(Attributes)
  9. java学习 (2)xml操作 SAX(增、删、改、查)
  10. java_web学习(1)理解JavaBean
  11. C/s从文件(TXT)中读取数据插入数据库
  12. 【java设计模式】【行为模式Behavioral Pattern】迭代器模式Iterator Pattern
  13. 团队作业7——第二次项目冲刺(Beta版本计划及安排)
  14. 在使用mysql8.0的时候遇到的密码链接问题
  15. Chrome & QR Code Reader
  16. 【rabbitmq】安装卸载
  17. 线程间通信wait和notify【All】简介
  18. MySQL: Connection Refused,调整 mysql.ini中的 max_connections
  19. Linux LVM逻辑卷配置过程详解(创建,增加,减少,删除,卸载)
  20. 字符串最长子串匹配-dp矩阵[转载]

热门文章

  1. go反射----3方法
  2. 【BZOJ4898】[Apio2017]商旅 分数规划+SPFA
  3. mysql导出csv文件
  4. NET Framework 4.5新特性 (一) 数据库的连接加密保护。
  5. SharePoint服务器端对象模型 之 访问网站和列表数据(Part 4)
  6. Java中,由this关键字引发的问题
  7. FtpUtil 工具类
  8. 新提交审核app保留检查更新入口将被拒绝
  9. 学习Hive和Impala必看经典解析
  10. Win10在右键菜单添加“在此处打开命令窗口”设置项