how do I replace the \ characters in a string with a single \. C#

This is a discussion on how do I replace the \ characters in a string with a single \. C# within the C# Programming forums, part of the General Programming Boards category; I get a string ( basically off the Application.StartupPath function) the issue is it has double backslashes something like "C:\WIP\C#\bin\Debug" ...

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    39

    how do I replace the \\ characters in a string with a single \. C#

    I get a string ( basically off the Application.StartupPath function)
    the issue is it has double backslashes
    something like
    "C:\\WIP\\C#\\bin\\Debug"
    I want t replace the double backslashes with a single backslash to look like this
    "C:\WIP\C#\bin\Debug"

    Thanks.

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,805
    Woop?

  3. #3
    Registered User
    Join Date
    Mar 2009
    Location
    england
    Posts
    209
    Are you sure the first back slash isn't an escape? I just tried Application.StartupPath in a test project and it seemed fine.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help for my assigment
    By cloverdagreat in forum C Programming
    Replies: 16
    Last Post: 11-21-2009, 11:18 AM
  2. Replies: 8
    Last Post: 04-25-2008, 02:45 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 04:45 PM
  4. Replies: 4
    Last Post: 10-14-2005, 12:53 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21