C# 替换所有的“;和';一串
我想替换字符串中的所有“and” eg字符串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
"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);