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 which have the issue is it has double backslashes something like "C:\WIP\C#\bin\Debug" I want t replace ...

  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 which have 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
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,852
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 12:18 PM
  2. Replies: 8
    Last Post: 04-25-2008, 03:45 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. Replies: 4
    Last Post: 10-14-2005, 01:53 PM

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