|
-
Sep 3rd, 2005, 03:26 PM
#1
Thread Starter
Lively Member
The @ symbol in front of some strings
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?
-
Sep 3rd, 2005, 03:30 PM
#2
<?="Moderator"?>
Re: The @ symbol in front of some strings
It gives you the literal string, not the escaped string.
Code:
strS1 = @"c:\windows\system32\";
strS2 = "c:\\windows\\system32\\";
Would be the same thing.
-
Sep 10th, 2005, 01:47 AM
#3
Fanatic Member
Re: The @ symbol in front of some strings
What does that mean? You mean,It makes no difference?
Godwin
Help someone else with what someone helped you! 
-
Sep 10th, 2005, 01:56 AM
#4
Re: The @ symbol in front of some strings
yep exactly, just saves the fingers a little 
but ...
You can also use the / slash instead of the \
eg:
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 );
}
Last edited by dynamic_sysop; Sep 10th, 2005 at 02:02 AM.
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Sep 11th, 2005, 12:17 AM
#5
Fanatic Member
-
Sep 11th, 2005, 06:29 AM
#6
Re: The @ symbol in front of some strings
Its general practice to always use @"" when you are doing paths. Using normal "" way is generally reserved for inline markup like "Hello\nWorld".
I don't live here any more.
-
Sep 11th, 2005, 06:53 AM
#7
Fanatic Member
Re: The @ symbol in front of some strings
Godwin
Help someone else with what someone helped you! 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|