The things I learnt while I migrated from classic asp to is given here for my reference as well as for new beginners.

Why @ symbol is used in string


Why "@" symbol is used in Strings?

The Wrong way of writng a string:

string x="c:\abc\hello.txt";

The Right way of writing the above string:

string x=@"c:\abc\hello.txt";

What is the difference between these two?

When you are using "@" symbol, you mean that the text is just a literal. But if you dont use "@" symbol, in the above case, the BACKSLASH will be treated as ESCAPE SEQUENCEand it will create errrors.


Thanks for Your Visit

Google Search
Disclaimer and Copy Right