相关疑难解决方法(0)

查找数组中值的索引

linq可以用某种方式来查找数组中值的索引吗?

例如,此循环在数组中定位键索引.

for (int i = 0; i < words.Length; i++)
{
    if (words[i].IsKey)
    {
        keyIndex = i;
    }
}
Run Code Online (Sandbox Code Playgroud)

c# linq arrays

107
推荐指数
4
解决办法
13万
查看次数

如何在VB.NET中搜索数组?

我希望能够有效地在数组中搜索字符串的内容.
例:

dim arr() as string={"ravi","Kumar","Ravi","Ramesh"}
Run Code Online (Sandbox Code Playgroud)

我传递的值是"ra",我希望它返回索引2和3.

我怎么能在VB.NET中做到这一点?

vb.net arrays

8
推荐指数
2
解决办法
10万
查看次数

标签 统计

arrays ×2

c# ×1

linq ×1

vb.net ×1