Let’s say I have a folder like ClientBin in my Visual Studio C# Web Application.
I’m confused as to what the @”” will do in the following C# code that tries to create a path to a Directory:
String DirectoryPath = System.IO.Path.Combine(@"" + "ClientBin");
Or when it comes to fa file like in the following example:
String FilePath = System.IO.Path.Combine("admin", "access", @"" + "users.aspx");
Basically, could someone please explain to me what the @”” has to do with the System.IO.Path.Combine method?
Adding
@means that any escape character sequences are ignored and the string is taken as it is written. Not quite, see the link below.is the same as
In the second case \\ sequence means escaped backslash character.
update: dtb is right about that
see string literals