0

Possible Duplicate:
What's the @ in front of a string for .NET?
when to use @ in c#?

I'm quite new at C# programming and, in many examples, in particular at MSDN, the following code piece appears quite frequently:

string NewString = @"Hello World";

I'm quite curious about what's the effect of the @ signal used in this code... is by any chance different than

string NewString = "Hello World";

Community
  • 1
  • 1
lagranzotto
  • 327
  • 1
  • 5
  • 16

1 Answers1

2

The @ introduces a raw string, which isn't preprocessed for escape sequences, such as \t. It is very convenient for regular expressions, which almost always include backslashes.

Nicola Musatti
  • 17,834
  • 2
  • 46
  • 55