Replace “\\” with “\” in a string in C#
问题 I still don\'t get how to do this. I saw many posts regarding this, but none of the solutions worked for me. I have a string called \"a\\\\b\". The result I need is \"a\\b\". How is this done? I have a text file which has a database connection string pointing to an instance called - Server\\DbInstance My aim is to do a string replace in the text file -- replace \"Server\\DbInstance\" with another value, say \"10.11.12.13, 1200\". So I have: stringToBeReplaced = @\"Server\\DbInstance\";