我想将所有不包含“时间”的单词放入组合框。
我试过了 :
foreach (string stt in LTypes)
{
//if the stat name does not contains TIME
//Only then we add it to the combobox.
if (!stt.Contains("Time"))
{
tcomboBox1.Items.Add(stt);
}
}
但是以上方法不起作用。“不起作用”是指包含“时间”的单词也被插入到了组合框中。
我哪里做错了 ?
也许是肠衣问题。
尝试这个:
if (!stt.ToUpperInvariant().Contains("TIME"))
不管情况如何,都可以使用。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句