c#判断一个数组是否包含给定的元素
string[] elements = new string[50];
if ( Array.IndexOf<string>( elements, "sss" ) != -1 )
{
//存在 //返回的值就是 "sss" 在数组中的下标
}
else
{
//不存在
}
string[] elements = new string[50];
if ( Array.IndexOf<string>( elements, "sss" ) != -1 )
{
//存在 //返回的值就是 "sss" 在数组中的下标
}
else
{
//不存在
}