- 忽略转义字符
- 让字符串跨行
- 在标识符中的用法中C#是不允许关键字作为标识符(类名、变量名、方法名、表空间名等)使用的,但如果加上@之后就可以了
public void GetVal(){
string s1 = "D:\\文本文件\\text.txt";
string s2 = @"D:\文本文件\text.txt";// 忽略转义字符
string b1 = "select * " +
"from table " +
"where 1=1";
// 让字符串跨行
string b2 = @"select *
from table
where 1=1";
// 允许关键字作为标识符
string @int = "@int";
Console.WriteLine(@int);
}