Can linq somehow be used to find the index of a value in an array?
For instance, this loop locates the key index within an array.
for (int i = 0; i &
If you want to find the word you can use
var word = words.Where(item => item.IsKey).First();
This gives you the first item for which IsKey is true (if there might be non you might want to use .FirstOrDefault()
To get both the item and the index you can use
KeyValuePair word = words.Select((item, index) => new KeyValuePair(item, index)).Where(item => item.Key.IsKey).First();