且构网

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

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

更新时间:2022-11-27 09:28:18

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

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