C# How to maintain the path as in string without replacing double slash

前端 未结 2 787
遇见更好的自我
遇见更好的自我 2021-01-28 06:03

I have a string with value

\"\\\\test\\mxf\\123456\\123456789.abc\"

When I use

var x= @\"\\\\test\\mxf\\123456\\123456789.abc         


        
相关标签:
2条回答
  • 2021-01-28 06:16

    Use Console to check strings and not the debugger :

    var x= @"\\test\mxf\123456\123456789.abc"
    
    Console.WriteLine(x); // output is \\test\mxf\123456\123456789.abc
    
    0 讨论(0)
  • 2021-01-28 06:31

    Try this,

    var x = "\"" + @"\\test\mxf\123456\123456789.abc" + "\"";;
    
    Console.WriteLine(x); 
    
    0 讨论(0)
提交回复
热议问题