How can I remove quoted string literals from a string in C#?

前端 未结 3 510
遇见更好的自我
遇见更好的自我 2021-01-21 00:28

I have a string:

Hello \"quoted string\" and \'tricky\"stuff\' world

and want to get the string minus the quoted parts back. E.g.,

3条回答
  •  猫巷女王i
    2021-01-21 01:04

    Use a regular expression to match any quoted strings with the string and replace them with the empty string. Use the Regex.Replace() method to do the pattern matching and replacement.

提交回复
热议问题