62,046
社区成员
发帖
与我相关
我的任务
分享
string str1= 长的;
string str2=短的;
string tmp = "iamaboy ";
if(str1.IndexOf( 短的) != -1)
{
result = "包含 ";
}
else
{
result = "不包含 ";
}
try
{
str1.Replace(str2, " ")
}
catch
{
Response.Write( "不包含 ");
}
public bool IsLike(string a, string b)
{
if (a == null || b == null)
return true;
if (a.Length == b.Length)
{
return string.Compare(a, b, true) == 0;
}
if (a.Length > b.Length)
{
return a.IndexOf(b) >= 0;
}
return b.IndexOf(a) >= 0;
}