Reputation: 205
This the sample data I am trying to remove single quotes ('
) from:
string address="Unnamed Road, Kemerovskaya oblast', Russia, 652226 ";
I just want to remove single quotation mark from the string, for example
string resultString="Unnamed Road, Kemerovskaya oblast, Russia, 652226 ";
Upvotes: 1
Views: 120
Reputation: 1530
try replace method,
string address="Unnamed Road, Kemerovskaya oblast', Russia, 652226 ";
resultString = address.Replace("'",string.Empty);
OR
resultString = address.Replace("'","");
Upvotes: 3
Reputation: 8271
You can use Replace
string address="Unnamed Road, Kemerovskaya oblast', Russia, 652226 ";
address = address.Replace("'",string.Empty);
or
address = address.Replace(@"'",string.Empty);
if you dont want to go for escape sequences to be recognized go for verbatim like this @"..."
Upvotes: 1