Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
3.00/5 (2 votes)
See more:
Hello,

I have a string path like this

string path = @"\\prespath\pahtA\pathB";

however when I read it to other class it will show like this

object.AObj = path;

the path show "\\\\prespath\\pahtA\\pathB"

How can i make the path show "\\prespath\pahtA\pathB"

thanks,
Posted

Also note that you can use the path class to work with paths. It provides functionality that will save you a lot of time and can minimize bugs.
http://msdn.microsoft.com/en-us/library/system.io.path.aspx[^]
 
Share this answer
 
v2
Comments
VJ Reddy 19-Apr-12 19:58pm    
Good suggestion. 5!
 
Share this answer
 
Comments
VJ Reddy 19-Apr-12 19:58pm    
Good info. 5!
Mohammad A Rahman 19-Apr-12 20:01pm    
Thank you very much VJ :)
[no name] 19-Apr-12 23:17pm    
Ditto
path show "\\\\prespath\\pahtA\\pathB"
It's ok. Go ahead with your implementation and use of the value. '\' (Backslash) is a escape sequence for '\'. Your path is as you have set. Don't worry, it's not wrong.

Read: Escape Sequence[^]
 
Share this answer
 
Comments
VJ Reddy 19-Apr-12 13:11pm    
5!
Clifford Nelson 19-Apr-12 13:26pm    
Agreed, my 5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900