且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

查找整数列表中是否存在整数

更新时间:2022-11-27 09:41:33

如果你只需要一个真假结果

If you just need a true/false result

bool isInList = intList.IndexOf(intVariable) != -1;

如果列表中不存在 intVariable 则返回 -1

if the intVariable does not exist in the List it will return -1