Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

replace \\ with \ 2

Status
Not open for further replies.

5679

Programmer
Feb 14, 2003
32
AU
newPath = newPath.Replace("\\","\");
^
new path is a string. with the above line of code, i get an error. how to solve this?
 
Or
Code:
newPath = newPath.Replace(@"\\", ""+Path.DirectorySeparatorChar);
to be platform independent.
-obislavu-




 
I vote for Obislavu's method using the constant.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top