如何判断字段A里边包括字段B??
如何判断字段A里边包括字段B??
打个比方 |1|2|3|里包括|3|
[解决办法]
indexof
[解决办法]
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