转义字符,用处还是很多的。比如
string a = "\\A";与string a = @"\A";就是一个意思,在传路径的时候,非常方便
string strSQL = "SELECT * FROM HumanResources.Employee AS e"
+ " INNER JOIN Person.Contact AS c"
+ " ON e.ContactID = c.ContactID"
+ " ORDER BY c.LastName";
加上@符号后就可以直接换行了:
string strSQL = @"SELECT * FROM HumanResources.Employee AS e
INNER JOIN Person.Contact AS c
你这个例子中没必要用@啊
我只知道加上@后,可以换行写,不加不能换行写