I have a List item
List xmlValue = new List();
In this I have Item {\"English\",\"Spanish\",\"French\",\
I'd opt against using the LINQ extension methods in this case and use an "old-fashioned" loop:
string search = "English";
var foundIndices = new List(xmlValue.Count);
for (int i = 0; i < xmlValue.Count; i++) {
if (xmlValue[i] == search) {
foundIndices.Add(i);
}
}
It's simply more readable like this in my opinion; also, the foundIndices list never holds any unwanted values.