Hello Mark,
The @ is used to to not require escape sequences. For example:
@"C:\Hello";
is C:\Hello
But:
"C:\Hello";
isn't valid because the \H is an escape sequence.
But...
"C:\\Hello"
is equivalent to:
@"C:\Hello"
Because \\ is an escape sequence for \
Does this help at all? Still using the @"" format is still not the same
as using VB.NET strings (as you can still continue a string past the end
of a line). FOr example:
string s = @"SELECT *
FROM Customers";
Is perfectly valid in C#, but in VB.NET this does not work:
dim s as String = "SELECT *
FROM Customers"
Thanks,
Shawn Wildermuth
Speaker, Author and C# MVP
http://adoguy.com
"thi" <th******@hotmail.comwrote in message
news:OD**************@TK2MSFTNGP03.phx.gbl...
>Hi,
Just curious what does the @ system means in c#. Some of the sample
codes i read it written as:
bool bExists = File.Exists(@"c:\\hello.txt");
but i can get the same result as using
bool bExists = File.Exists("c:\hello.txt");
Does @ has special meaning?
Look more closely at those two statements and you'll see the
difference. Then, get a book on C#.
///ark