使用DataTable.Select 方法时,特殊字符的转义方法分享
地画,偷拍美女,童丽照片
public static string replace(string oldstr)
{
if (string.isnullorempty(oldstr))
{
return "";
}
string str2 = regex.replace(oldstr, @"[\[\+\\\|\(\)\^\*\""\]'%~#-&]", delegate(match match)
{
if (match.value == "'")
{
return "''";
}
else
{
return "[" + match.value + "]";
}
});
return str2;
}
如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!!
点击进行留言回复
网友评论