How to replace the below string in C#
Current:
\"John K \"GEN\" Greg\"
The Goal:
\"John K \\\"GEN\\\" Greg\"
You should use a double backslash:
s = s.Replace("\"", "\\\"");