C#从带引号的字符串中删除分隔符

New*_*art 5 c# regex string text-files

我正在编写一个程序,必须从文本文件中的引用字符串中删除分隔符.

例如:

"Hello, my name is world"
Run Code Online (Sandbox Code Playgroud)

必须:

"Hello my name is world"
Run Code Online (Sandbox Code Playgroud)

这听起来很容易(我认为会这样),但你需要检测引用何时开始,当引用结束时,然后搜索特定字符串以查找分隔符.怎么样?

我已经尝试了一些正则表达式,但我只是让自己感到困惑!

有任何想法吗?即使只是让球滚动的东西,我只是完全难倒.

Mat*_*att 4

string pattern = "\"([^\"]+)\"";
value = Regex.Match(textToSearch, pattern).Value;

string[] removalCharacters = {",",";"}; //or any other characters
foreach (string character in removalCharacters)
{
    value = value.Replace(character, "");
}
Run Code Online (Sandbox Code Playgroud)