确定数组是否存在没有循环的数组 [英] Determine if a Value Exists in an Array without Looping s
本文介绍了确定数组是否存在没有循环的数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用vb.net确定数组是否存在没有循环的数组.....
Determine if a Value Exists in an Array without Looping using vb.net .....
推荐答案
基本上,你不能,除非你检查每个个别元素:
Basically, you can't, unless you check each individual element by hand:
if (arr[0] == value) ...
if (arr[1] == value) ...
...
虽然(正如Kenneth所说)有Linq扩展方法,例如Contains,它将返回是/否答案,他们所做的就是隐藏循环。
Although (as Kenneth has said) there are Linq extension methods such as Contains which will return a "yes/no" answer, allthey do is "hide" the loop.
这篇关于确定数组是否存在没有循环的数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文