Hi......
Which string prevent escaping on backslash in C# ? Please explain ?
Thanks......
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Feb 6, 2012, 6:34 PM
You could have achieved the same effect as the verbatim string by simply doubling the backslashes which enables them to be treated as an ordinary character rather than an escape character prefix:
string s = "\\t\\n"; // same effect as @"\t\n"
Vineet Kumar SainiPosted Feb 8, 2012, 3:29 PM
Jignesh TrivediPosted Feb 6, 2012, 10:45 PM
I have the same opinion as vulpes..
you have only two option.
string d= @"c:\TestProject";
or
string d = "C:\\testProject";
hope this help.