someobject.stringProperty = @mycontrol.Text;
What does the @ do in that case?
Is that a clone operator?
It's hard to say whether that's even valid code. But assuming it is, it's
indicating to the compiler that the variable "@mycontrol" should not be
confused with some built-in keyword "mycontrol".
Usually you'd only see that in some sort of auto-generated code.
Hand-written code would normally only use "@" if the variable name did in
fact conflict with an existing C# keyword.
Pete
the @ can be used with strings. not sure if can be used with var
names.
For strings you can use for @"c:\Docs\Source\a.txt" rather than "c:\
\Docs\\Source\\a.txt"
Al Schulz
http://alsql.blogspot.com
The prefix "@" enables the use of keywords as identifiers, which is
useful when interfacing with other programming languages. The
character @ is not actually part of the identifier, so the identifier
might be seen in other languages as a normal identifier, without the
prefix. An identifier with an @ prefix is called a verbatim
identifier. Use of the @ prefix for identifiers that are not keywords
is permitted, but strongly discouraged as a matter of style.
From MSDN
http://msdn.microsoft.com/en-us/library/aa664670(VS.71).aspx