For one method I have the parameters take a string, but I need that string to become a verbatim string once in the method. Here is an example of what I mean.
//the string I have
string test = "c:\\documents\\testfile\\test.txt"
//the string I want
string converted = @"c:\\documents\\testfile\\test.txt"
how do I go about converting this using the test identifier?
I have tried:
string test = "c:\\documents\\testfile\\test.txt"
string converted = @test;
string converted = @+test;
string converted = @""+test;
Is there a way I can do this? Thanks
You can't use the verbatim identifier like you are trying to. You'll have to do something along the lines of: