此示例数据我尝试从
中删除单引号(sed -rn ':a;N;/^([^\n]*)\n\1$/p;//ba;/^([^\n]*)(\n\1)+$/P;//ba;s/.*\n//;ba' file
)
'
我只想从字符串中删除单引号,例如
string address="Unnamed Road, Kemerovskaya oblast', Russia, 652226 ";
答案 0 :(得分:3)
尝试替换方法,
string address="Unnamed Road, Kemerovskaya oblast', Russia, 652226 ";
resultString = address.Replace("'",string.Empty);
或强>
resultString = address.Replace("'","");
答案 1 :(得分:1)
您可以使用替换
string address="Unnamed Road, Kemerovskaya oblast', Russia, 652226 ";
address = address.Replace("'",string.Empty);
或
address = address.Replace(@"'",string.Empty);
如果您不想要识别转义序列,请选择逐字,例如@"..."