linq可以用某种方式来查找数组中值的索引吗?
例如,此循环在数组中定位键索引.
for (int i = 0; i < words.Length; i++)
{
if (words[i].IsKey)
{
keyIndex = i;
}
}
Run Code Online (Sandbox Code Playgroud) 我希望能够有效地在数组中搜索字符串的内容.
例:
dim arr() as string={"ravi","Kumar","Ravi","Ramesh"}
Run Code Online (Sandbox Code Playgroud)
我传递的值是"ra",我希望它返回索引2和3.
我怎么能在VB.NET中做到这一点?