The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,380 other followers

Archive for March 28th, 2012

naming – What’s the use/meaning of the @ character in variable names in C#? – Stack Overflow

Posted by jpluimers on 2012/03/28

Duh, I always thought @ could only be used for strings.

Not so: just like with the & in Delphi is used to escape keywords, the additional use of @ in C# is to escape identifiers:

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.

–jeroen

via: naming – What’s the use/meaning of the @ character in variable names in C#? – Stack Overflow.

Posted in .NET, C#, C# 2.0, C# 3.0, C# 4.0, Delphi, Development, Software Development | Leave a Comment »

 
%d bloggers like this: