I see this @ character a lot in front of C# strings. I searched the documentation online but coult not come up with the page that explains this symbol. What is it used for?
Printable View
I see this @ character a lot in front of C# strings. I searched the documentation online but coult not come up with the page that explains this symbol. What is it used for?
It gives you the literal string, not the escaped string.
Would be the same thing.Code:strS1 = @"c:\windows\system32\";
strS2 = "c:\\windows\\system32\\";
What does that mean? You mean,It makes no difference?
yep exactly, just saves the fingers a little :)
but ...
You can also use the / slash instead of the \
eg:
:wave:VB Code:
[COLOR=Blue]private void[/COLOR] button1_Click([COLOR=Blue]object[/COLOR] sender, System.EventArgs e) { [COLOR=Blue]string[/COLOR] path = "C:/Documents and Settings/den/My Documents/My Pictures/twins.jpg"; System.Diagnostics.Process.Start( path ); }
:eek: :eek: :eek:
Hey Dynamic...
Since when was this possible?
This is Amazing...I remember this didnt work long ago...I wonder when both slashes meant the same.This is Awesome.Thanks so much for this info. :thumb: :thumb: :thumb: :thumb:
Its general practice to always use @"" when you are doing paths. Using normal "" way is generally reserved for inline markup like "Hello\nWorld".
Roger that...