title: Replace "\\" with "\" in a string in C#
body: <p>I still don't get how to do this. I saw many posts regarding this, but none of the solutions worked for me.</p>
  
  <p>I have a string called "a\\b". The result I need is "a\b". How is this done?</p>
  
  <p>I have a text file which has a database connection string pointing to an instance called - Server\DbInstance</p>
  
  <p>My aim is to do a string replace in the text file -- replace "Server\DbInstance" with another value, say "10.11.12.13, 1200".</p>
  
  <p>So I have:</p>
  
  <pre><code>stringToBeReplaced = @"Server\DbInstance";
  newString = @"10.11.12.13, 1200";
  </code></pre>
  
  <p>This is where the problem starts. My stringToBeReplaced will always be "Server\\DbInstance", and when I search for this string in my text file, the search fails, as the text file doesn't have a string "Server\\DbInstance"; instead it has only "Server\DbInstance". So how do change "Server\\DbInstance" to "Server\DbInstance"?</p>