First, there's no way you will locate the first item in a list that matches a condition, or,
all items in a List that match some condition without
iteration: using Linq will just "automate" that for you.
The question for you to clarify here is what exactly
you want returned from your iteration of a list of strings:
1. a list of indexes in the list where strings convertible to bool values are ?
2. or, a just a bunch of boolean values in a list: without the indexes, hard to imagine a use for that.
3. or, to take some action (execute some code) for each string that can be converted to bools based on the boolean value and/or the index of that value in the list of strings ? imho, a more plausible use-case.
4. see my comment on your post above for what else you need to clarify
I'll show you an example here of returning the list of strings as a Dictionary<int, bool> ... where the 'key is the index of the boolean value in the list, and the value is the converted boolean value.
using System.Linq
List<string> strList = new List<string>
{
"True", "what", "False", "True", "ozone", "False"
};
bool booltest = false;
Dictionary<int,bool> dctIntBool = strList
.Select((str, index) => new {index, str})
.Where(pair => Boolean.TryParse(pair.str, out booltest))
.ToDictionary(pair => pair.index, pair => booltest);
Note the variation of Linq 'Select that creates/preserves an index of the collection it iterates is used here: each pair of index/value is projected into a new anonymous structure; then, the Where Linq statement filters those "pairs" so any pair where the string is not convertible to 'bool is discarded; finally, Linq ToDictionary is used to create the Dictionary structure, using, for the Value of each KeyValuePair the boolean value assigned to 'booltest by the 'TryParse statement in the Where clause.