zoukankan      html  css  js  c++  java
  • C# @的用法

    1. 忽略转义字符
    2. 让字符串跨行
    3. 在标识符中的用法中C#是不允许关键字作为标识符(类名、变量名、方法名、表空间名等)使用的,但如果加上@之后就可以了
     1 public void GetVal(){
     2     string s1 = "D:\文本文件\text.txt";
     3     string s2 = @"D:文本文件	ext.txt";// 忽略转义字符
     4     string b1 = "select * " +
     5                 "from table " +
     6                 "where 1=1";
     7     // 让字符串跨行
     8     string b2 = @"select * 
     9                 from table 
    10                 where 1=1";
    11     // 允许关键字作为标识符
    12     string @int = "@int";
    13     Console.WriteLine(@int);
    14 }
  • 相关阅读:
    打印日志宏定义
    数据库读写操作
    SQL语句组成
    MySQL数据库的使用
    ubuntu下解决MySQL 1045 error
    css样式优先级
    redis
    dubbo
    maven
    Mybatis笔记
  • 原文地址:https://www.cnblogs.com/My-Sun-Shine/p/13513852.html
Copyright © 2011-2022 走看看