Double quote string replace in C#

后端 未结 6 619
野性不改
野性不改 2020-12-05 09:15

How to replace the below string in C#

Current:

\"John K \"GEN\" Greg\"

The Goal:

 \"John K \\\"GEN\\\" Greg\"
         


        
6条回答
  •  臣服心动
    2020-12-05 10:13

    To remove ALL quotes from a string, try:

    field.Value = Regex.Replace(field.Value, @"[\""]", "", RegexOptions.None);

    What a pain trying to find this answer on the internet!

提交回复
热议问题