Glenn Patton

Glenn Patton

  • NA
  • 308
  • 82.7k

Adding double \ to file name from a text box....

May 22 2012 7:35 AM
Hi All,

Very simple one today I have a text box containing the path to be used for a save file
ie: C:\Test\Test_One I need text box (txtPath.Text) to contain C:\\Test\\Test_One for the file writing system so what is the correct way of putting an extra \ in text of the path.  I did try txtPath.Text.Replace('\','\\'); but this came back as syntax error as '\\' is not a single character so I tried it as a string ("\\","\\\\"), this appeared to work. The issue is now how can I get C:\\Test\\Test_One to be seen as C:\Test\Test_One or will it be seen that way anyway.

Glenn 

Answers (3)