Double quote string replace in C#

后端 未结 6 611
野性不改
野性不改 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

    string MailFrom ="aaa@my.web.pk;\"PROMMS\" ccc@my.web.pk;";
    
    string NewMailFrom = Regex.Replace(MailFrom, "\"[^\"]*\"", string.Empty);
    
    
    Results
    
    aaa@my.web.pk;ccc@my.web.pk;
    

提交回复
热议问题