By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,162 Members | 1,416 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,162 IT Pros & Developers. It's quick & easy.

the symbol

P: n/a
hey all,
what does the @ symbol in front of a string mean? @"mystringvalue"

thanks,
rodchar
Feb 2 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On 2 Feb, 14:46, rodchar <rodc...@discussions.microsoft.comwrote:
hey all,
what does the @ symbol in front of a string mean? @"mystringvalue"

thanks,
rodchar
It means take everything after it as the string, so

Console.WriteLine("W\tW");
Console.WriteLine(@"W\tW");

In the first case will write W tab W and in the second will write W\tW
where tab is an actual tab.

Feb 2 '07 #2

P: n/a
means to read characters such as '\' correctly

So if you had a path and you dont want the string read as an escape sequence
you put the @ in front.

"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:16**********************************@microsof t.com...
hey all,
what does the @ symbol in front of a string mean? @"mystringvalue"

thanks,
rodchar

Feb 2 '07 #3

P: n/a
"rodchar" <ro*****@discussions.microsoft.comwrote in message
news:16**********************************@microsof t.com...
what does the @ symbol in front of a string mean? @"mystringvalue"
It means a string literal e.g.

string strFolder = "C:\\My Documents";

and

string strFolder = @"C:\My Documents";

will both evaluate to the same string variable...

http://www.google.co.uk/search?sourc...literal%22+%40
Feb 2 '07 #4

P: n/a
thanks everyone for the help. i appreciate it. rodman.

"rodchar" wrote:
hey all,
what does the @ symbol in front of a string mean? @"mystringvalue"

thanks,
rodchar
Feb 2 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.