string path = "C:\Hg\temp\\LogFile.txt"; string output = path.Replace(@"\\", @"\"); output >>> C:\Hg\temp\LogFile.txt