日期:2014-05-18 浏览次数:20484 次
string s = "123";
if (s.Contains("3") == true)
{
//包含3
}
else
{
//不包含3
}
------解决方案--------------------
string str="¦1 ¦2 ¦3";
int i = str.indexof("¦3");
if(i>0)
{
//存在
}
else
{
//不存在
}
感觉 这个效率还行吧。
------解决方案--------------------
string.Contain("3");
string.IndexOf("3");
System.Text.RegularExpressions.Regex.IsMatch(inputString, "*3*");
------解决方案--------------------
select *,case when charindex(b,a)>0 then 1 else 0 end from tb