我有一个数组和一个循环,我想找到当前项目的索引,以便我可以决定是否在列表框中显示该项目,
string[] papers = new string[7] { "Software Development", "Data Fundamentals", "Information and Communication", "User Support", "Web Fundamentals", "Network Fundamentals", "Computer Fundamentals" };
for (int i = 0; i < papers.Length; i++)
{
int n=papers.Length;
if (n==2)
{
continue;
}
else
{
listView1.Items.Add(papers[i]);
}
}
但我无法实现它,请有人帮助我......或者有更好的方法吗?
谢谢