我要全部更换”和”从字符串全部替换“和“从字符串
如串
"23423dfd
"'43535fdgd
""'4353fg
""'''3453ere
结果应该是
23423dfd
43535fdgd
4353fg
3453ere
我想这myString.Replace("'",string.Empty).Replace('"',string.Empty);
但它没有给我正确的结果。
我要全部更换”和”从字符串全部替换“和“从字符串
如串
"23423dfd
"'43535fdgd
""'4353fg
""'''3453ere
结果应该是
23423dfd
43535fdgd
4353fg
3453ere
我想这myString.Replace("'",string.Empty).Replace('"',string.Empty);
但它没有给我正确的结果。
mystring = mystring.Replace("\"", string.Empty).Replace("'", string.Empty)
做两个替代对象:
s = s.Replace("'", "").Replace("\"", "");
试试这个:
string s = yoursting.Replace("\"", string.Empty).Replace("'", string.Empty);
你尝试[与string.replace(http://msdn.microsoft。 com/en-us/library/system.string.replace.aspx)? – Habib 2013-04-10 12:35:40
@Habib:是的,我尝试过,“\”就是我想要的 – 2013-04-10 12:38:16
你应该发布你尝试过的东西,以及你在哪里被困在 – Habib 2013-04-10 12:38:58