Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a simple question that I can't find a answer to:

With the .NET Framework what is the difference in saying "folder1/folder2/file" and "folder1\\folder2\\file" in a file directory? Is there even a difference?

Also what does the "@" character do? I'm not sure if this is XNA specific or .NET specific but here is an example: ContentManager.Load<Texture2D>(@"SpriteSheets/Tile");


share|improve this question
AFAIk, @"S:\ome\path\file.ext" will turn the string into "S:\\ome\\path\\file.ext" for you, so you don't have to escape it yourself. – melak47 Sep 16 '12 at 3:31
up vote 4 down vote accepted

Here is a resource on what @""-style string literals are.

Basically they turn off escaping. So, for example, you only need @"\", instead of "\\" to get the \ character.

Another example: @"\t" gives you \t, whereas "\t" (no at symbol) gives you a tab character.

Internally XNA handles the difference between path separator characters. You can use \ or / (or some crazy combination of both) and it won't matter.

(I'm pretty sure Windows itself doesn't care which character you use either.)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.