Question: > 
> **Possible Duplicate:**  
> 
> [What's the @ in front of a string for .NET?](https://stackoverflow.com/questions/556133/whats-the-in-front-of-a-string-for-net) 
> 
> 
> 

I understand using the `@` symbol is like an escape character for a string.

However, I have the following line as a path to store a file to a mapped network drive:

`String location = @"\\192.168.2.10\datastore\\" + id + "\\";`

The above works fine but now I would like to get a string from the command line so I have done this:

`String location = @args[0] + id + "\\";`

The above doesn't work and it seems my slashes aren't ignored. This my command:

`MyProgram.exe "\\192.168.2.10\datastore\\"`

How can I get the effect of the `@` symbol back?

Answer: 
The @ prefix means the string is a literal string and the processing of escape characters is not performed by the compiler, so:

```
@"\n"

```

is not translated to a newline character. Without it, you'd have:

```
String location = "\\\\192.168.2.10\\datastore\\\\" + id + "\\\\";

```

which looks a bit messy. The '@' tidies things up a bit. The '@' can only be prefixed to string constants, that is, things inside a pair of double quotes ("). Since it is a compiler directive it is only applied at compile time so the string must be known at compile time, hence,

```
@some_string_var

```

doesn't work the way you think. However, since all the '@' does is stop processing of escaped characters by the compiler, a string in a variable already has the escaped character values in it (10,13 for '\n', etc). If you want to convert a '\n' to 10,13 for example at run time you'll need to parse it yourself doing the required substitutions (but I'm sure someone knows a better way).

To get what you want, do:

```
String location = args[0] + id + "\\";

```
By default the '\' character is an escape character for strings in C#. That means that if you want to have a backslash in your string you need two slashes the first to escape the second as follows:

```
string escaped = "This is a backslash \\";
//The value of escaped is - This is a backslash \

```

An easier example to follow is with the use of quotes:

```
string escaped = "To put a \" in a string you need to escape it";
//The value of escaped is - To put a " in a string you need to escape it

```

The @ symbol is the equivalent of "ignore all escape characters in this string" and declare it verbatim. Without it your first declaration would look like this:

```
"\\\\192.168.2.10\\datastore\\\\" + id + "\\";

```

Note that you already didn't have the @ on your second string, so that string hasn't changed and still only contains a single backslash.

You only need to use the @ symbol when you are declaring strings. Since your argument is already declared it is not needed. So your new line can be:

```
String location = args[0] + id + "\\";

```

or

```
String location = args[0] + id + @"\";

```