c# - Why does .NET add an additional slash to the already existent slashes in a path? -


I've found that adding additional slashes ( \ c: \ test . When I inspect the string with this path in the text view, the actual string is c: \\ test .

Why is this? It confuses me, as sometimes I want to divide the path (using string.Split () ), but wondering which string to use (one or two Slash).

. Net is not adding anything to your string. Your impression of seeing how the debugger chooses to display the string. C # string can be displayed in 2 forms

  • Verbatim strings: Prefix with a @ is required \\ alphabets \\ characters need to avoid themselves

    Debugger string displayed as a normal string Will versus a verb string, this is just an issue of performance, however, its implications The value does not affect.

Comments