string RegEsc(string str)
{
string[] pattern ={ @"%", @"_", @"'" };
foreach (string s in pattern)
{
switch (s)
{
case "%":
str = str.Replace(s, "[%]");
break;
case "_":
str = str.Replace(s, "[_]");
break;
case "'":
str = str.Replace(s, "['']");
break;
}
}
return str;
}
阅读(2552) | 评论(0) | 转发(0) |