110,538
社区成员
发帖
与我相关
我的任务
分享
private string FormatText(string text,bool flag)
{
if(flag) text=text.Replace("'","''");//保留'号
else text=text.Replace("'","");//去掉'号
return text;
}
那要看是在什么情况下了。。
假如有个:string text=this.textBox.Text;
一般可以这样:(看你需要哪种了)
text=text.Replace("'","''");//保留'号
text=text.Replace("'","");//去掉'号