Hi Rob,
@ in front of a string has two functions. The most commonly known is that
it will treat \ as a regular character instead of an escape character,
which is handy when writing file paths
@"C:\Folder\File.txt";
instead of
"C:\\Folder\\File.txt";
It will also let you write over several lines (ignoring line breaks)
@"
Line1
Line2
";
instead of
"\r\nLine1\r\nLine2\r\n";
or
"\r\n";
+ "Line1\r\n";
+ "Line2\r\n";
Which is handy for Xml etc
On Thu, 23 Nov 2006 09:00:11 +0100, greenrob <ro*******@gmail.comwrote:
hello,
I am just wondering what is the different by putting an extra "@" sign
in front of string delcaration ? Specifically :
string test = "hahaha";
string test1 = @"huhuuh";
What is the difference between test and test1 above ?
Thanks a bunch.
rgds
Rob
--
Happy Coding!
Morten Wennevik [C# MVP]