Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 替换所有的“;和';一串_C# - Fatal编程技术网

C# 替换所有的“;和';一串

C# 替换所有的“;和';一串,c#,C#,我想替换字符串中的所有“and” eg字符串 "23423dfd "'43535fdgd ""'4353fg ""'''3453ere 结果应该是 23423dfd 43535fdgd 4353fg 3453ere 我尝试了这个myString.Replace(“”,string.Empty).Replace(“”,string.Empty)但它没有给我正确的结果。执行两个替换: s = s.Replace("'", "").Replace("\"", ""); 使用 试试这个: stri

我想替换字符串中的所有“and”

eg字符串

"23423dfd
"'43535fdgd
""'4353fg
""'''3453ere
结果应该是

23423dfd
43535fdgd
4353fg
3453ere
我尝试了这个
myString.Replace(“”,string.Empty).Replace(“”,string.Empty)但它没有给我正确的结果。

执行两个替换:

s = s.Replace("'", "").Replace("\"", "");
使用

试试这个:

string s = yoursting.Replace("\"", string.Empty).Replace("'", string.Empty);

你试过了吗?@Habib:是的,我试过了,“\”是我想要的。你应该把你试过的东西和卡住的地方贴出来at@Habib:好的,哈比布,我以后会处理这个问题。如果有用的话,请把问题也投上一票。
string s = yoursting.Replace("\"", string.Empty).Replace("'", string.Empty);