well, this is the answer to your question but you are probably asking the wrong question,
var transformedString = badString.Replace(@"\", @"\\");
The @
in the literal means, this is a verbatim string so normal escaping rules don't apply. Effectively, you don't need to escape the escape character.